|
Terrier IR Platform 2.2.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object uk.ac.gla.terrier.matching.CollectionResultSet
public class CollectionResultSet
This class implements the interface ResultSet and
models the set of all documents in the
collection. It encapsulates two arrays, one for
the docids and one for the scores. It has also the
occurrences matrix which counts how many query terms
appear in each of the retrieved documents. The
metadata related methods are empty.
This class is only used internally by the Matching
class and the classes that extent it, because the
arrays for the docids and scores contain one entry
for each document in the collection. Therefore, the
instantiation of an object of this class can be
expensive. Access to the retrieved documents is enabled
by using the method GetResultSet that returns a cropped
result set.
Constructor Summary | |
---|---|
CollectionResultSet()
Deprecated. This constructor must not be used anymore. Use constructors specifying the number of documents in the collection. |
|
CollectionResultSet(int numberOfDocuments)
A default constructor for the result set with a given number of documents. |
|
CollectionResultSet(ResultSet resultSet)
A default constructor for the result set with a given instance of the result set. |
Method Summary | |
---|---|
void |
addMetaItem(java.lang.String name,
int docid,
java.lang.String value)
Empty method. |
void |
addMetaItems(java.lang.String name,
java.lang.String[] values)
Empty method. |
int[] |
getDocids()
Returns the documents ids after retrieval |
int |
getExactResultSize()
Returns the exact size of the result set. |
java.util.concurrent.locks.Lock |
getLock()
Returns the lock for enabling the modification of the result set by more than one threads. |
java.lang.String |
getMetaItem(java.lang.String name,
int docid)
Empty method. |
java.lang.String[] |
getMetaItems(java.lang.String name)
Empty method. |
short[] |
getOccurrences()
Returns the occurrences array. |
ResultSet |
getResultSet(int[] positions)
Extracts a subset of the resultset given by the list parameter, which contains a list of positions in the resultset that should be saved. |
ResultSet |
getResultSet(int start,
int length)
Crops the existing result file and extracts a subset from the given starting point to the ending point. |
int |
getResultSize()
Returns the effective size of the result set. |
double[] |
getScores()
Returns the documents scores after retrieval |
int |
getStatusCode()
Returns the status code for the current result set. |
void |
initialise()
Initialises the arrays prior of retrieval. |
void |
initialise(double[] scs)
Initialises the result set with the given scores. |
void |
setExactResultSize(int newExactResultSize)
Sets the exact size of the result set, that is the number of documents that would be retrieved, if the result set was not truncated. |
void |
setResultSize(int newResultSize)
Sets the effective size of the result set, that is the number of documents to be sorted after retrieval. |
void |
setStatusCode(int _statusCode)
Sets the status code for the current result set. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CollectionResultSet()
public CollectionResultSet(int numberOfDocuments)
numberOfDocuments
- the number of documents contained in the result set.public CollectionResultSet(ResultSet resultSet)
resultSet
- The given result set.Method Detail |
---|
public java.util.concurrent.locks.Lock getLock()
getLock
in interface ResultSet
public int getStatusCode()
getStatusCode
in interface ResultSet
public void setStatusCode(int _statusCode)
setStatusCode
in interface ResultSet
public int[] getDocids()
getDocids
in interface ResultSet
public int getResultSize()
getResultSize
in interface ResultSet
public short[] getOccurrences()
getOccurrences
in interface ResultSet
public int getExactResultSize()
getExactResultSize
in interface ResultSet
public double[] getScores()
getScores
in interface ResultSet
public void initialise()
initialise
in interface ResultSet
public void initialise(double[] scs)
initialise
in interface ResultSet
scs
- double[] the scores to initiliase the result set with.public void setResultSize(int newResultSize)
setResultSize
in interface ResultSet
newResultSize
- int the effective size of the result set.public void setExactResultSize(int newExactResultSize)
setExactResultSize
in interface ResultSet
newExactResultSize
- int the effective size of the result set.public void addMetaItem(java.lang.String name, int docid, java.lang.String value)
addMetaItem
in interface ResultSet
name
- the name of the metadata type. For example, it can be
the url for adding the URLs of documents.docid
- the document identifier of the document.value
- the metadata value.public void addMetaItems(java.lang.String name, java.lang.String[] values)
addMetaItems
in interface ResultSet
name
- the name of the metadata type. For example, it can
be the url for adding the URLs of documents.values
- the metadata values.public java.lang.String getMetaItem(java.lang.String name, int docid)
getMetaItem
in interface ResultSet
name
- the name of the metadata type.docid
- the document identifier of the document.
public java.lang.String[] getMetaItems(java.lang.String name)
getMetaItems
in interface ResultSet
name
- the name of the metadata type.
public ResultSet getResultSet(int start, int length)
getResultSet
in interface ResultSet
start
- the beginning of the subset.length
- the end of the subset.
public ResultSet getResultSet(int[] positions)
getResultSet
in interface ResultSet
positions
- int[] the list of elements in the current list
that should be kept.
|
Terrier IR Platform 2.2.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |