Class MemoryDocumentIndexFields
- java.lang.Object
-
- org.terrier.realtime.memory.MemoryDocumentIndex
-
- org.terrier.realtime.memory.fields.MemoryDocumentIndexFields
-
- All Implemented Interfaces:
java.io.Serializable
,DocumentIndex
,FieldDocumentIndex
public class MemoryDocumentIndexFields extends MemoryDocumentIndex implements FieldDocumentIndex
Document index (fields).- Since:
- 4.0
- Author:
- Stuart Mackie
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
MemoryDocumentIndexFields.DocumentIterator
class
MemoryDocumentIndexFields.DocumentIterator2
-
Field Summary
-
Fields inherited from class org.terrier.realtime.memory.MemoryDocumentIndex
docLengths
-
-
Constructor Summary
Constructors Constructor Description MemoryDocumentIndexFields()
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addDocument(int length, int[] flengths)
Add document length and field lengths to document index.DocumentIndexEntry
getDocumentEntry(int docid)
Return the document index entry based on its docid.int[]
getFieldLengths(int docid)
Get the length of each fieldjava.util.Iterator<DocumentIndexEntry>
iterator()
Return an iterator over the document index.java.util.Iterator<java.util.Map.Entry<java.lang.Integer,DocumentIndexEntry>>
iteratorOverEntries()
Return an iterator over the document index.-
Methods inherited from class org.terrier.realtime.memory.MemoryDocumentIndex
addDocument, getDocumentLength, getNumberOfDocuments, setLength
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.terrier.structures.DocumentIndex
getDocumentLength, getNumberOfDocuments
-
-
-
-
Method Detail
-
addDocument
public void addDocument(int length, int[] flengths)
Add document length and field lengths to document index.
-
getFieldLengths
public int[] getFieldLengths(int docid)
Get the length of each field- Specified by:
getFieldLengths
in interfaceFieldDocumentIndex
-
getDocumentEntry
public DocumentIndexEntry getDocumentEntry(int docid)
Return the document index entry based on its docid.- Specified by:
getDocumentEntry
in interfaceDocumentIndex
- Overrides:
getDocumentEntry
in classMemoryDocumentIndex
- Returns:
- the document index entry based on its docid.
-
iteratorOverEntries
public java.util.Iterator<java.util.Map.Entry<java.lang.Integer,DocumentIndexEntry>> iteratorOverEntries()
Return an iterator over the document index. iterates over Map.Entry, where the key is the integer docid - only used my the Memory index, not the index-on-disk.- Overrides:
iteratorOverEntries
in classMemoryDocumentIndex
-
iterator
public java.util.Iterator<DocumentIndexEntry> iterator()
Return an iterator over the document index.- Overrides:
iterator
in classMemoryDocumentIndex
-
-