Package com.attivio.sdk.search
Class SearchDocumentList
- java.lang.Object
-
- com.attivio.sdk.search.SearchDocumentList
-
- All Implemented Interfaces:
java.io.Externalizable
,java.io.Serializable
,java.lang.Iterable<SearchDocument>
public class SearchDocumentList extends java.lang.Object implements java.lang.Iterable<SearchDocument>, java.io.Externalizable
A list of SearchDocuments returned for a query.The size of the list will be less than or equal to the number of rows requested via
QueryRequest.setRows(long)
.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SearchDocumentList()
The default constructorSearchDocumentList(int initialSize)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(SearchDocument value)
void
clear()
boolean
containsDocument(java.lang.String docID)
Tells whether this document list contains a given document based on document ID.boolean
equals(java.lang.Object other)
void
forEach(java.util.function.Consumer<? super SearchDocument> consumer)
SearchDocument
get(int index)
SearchDocument
getDocument(java.lang.String id)
Gets a document from this list by ID.float
getMaxScore()
Get the maximum score across all matching documents.long
getNumberFound()
long
getOffset()
Get the offset that into the overall result set for the first document in this SearchDocumentList.int
hashCode()
java.util.Iterator<SearchDocument>
iterator()
void
readExternal(java.io.ObjectInput in)
void
setMaxScore(float value)
void
setNumberFound(long nf)
void
setOffset(long value)
Set the offset that into the overall result set for the first document in this SearchDocumentList.int
size()
java.lang.String
toString()
void
writeExternal(java.io.ObjectOutput out)
-
-
-
Method Detail
-
getOffset
public long getOffset()
Get the offset that into the overall result set for the first document in this SearchDocumentList.
-
setOffset
public void setOffset(long value)
Set the offset that into the overall result set for the first document in this SearchDocumentList.
-
getNumberFound
public long getNumberFound()
-
setNumberFound
public void setNumberFound(long nf)
-
setMaxScore
public void setMaxScore(float value)
-
size
public int size()
-
get
public SearchDocument get(int index)
-
iterator
public java.util.Iterator<SearchDocument> iterator()
- Specified by:
iterator
in interfacejava.lang.Iterable<SearchDocument>
-
forEach
public void forEach(java.util.function.Consumer<? super SearchDocument> consumer)
- Specified by:
forEach
in interfacejava.lang.Iterable<SearchDocument>
-
add
public void add(SearchDocument value)
-
clear
public void clear()
-
getMaxScore
public float getMaxScore()
Get the maximum score across all matching documents.NOTE: this will be 0.0 if the result is not orderd by score and document scores are not requested. Adding
FieldNames.SCORE
field toQueryRequest
will force computation of max score.
-
containsDocument
public boolean containsDocument(java.lang.String docID)
Tells whether this document list contains a given document based on document ID.- Parameters:
docID
- the document ID- Returns:
- true if the list contains a document with the specified ID
-
getDocument
public SearchDocument getDocument(java.lang.String id)
Gets a document from this list by ID.- Parameters:
id
- the ID to look for- Returns:
- the document or null if not in this list
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
readExternal
public void readExternal(java.io.ObjectInput in) throws java.io.IOException
- Specified by:
readExternal
in interfacejava.io.Externalizable
- Throws:
java.io.IOException
-
writeExternal
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
- Specified by:
writeExternal
in interfacejava.io.Externalizable
- Throws:
java.io.IOException
-
-