Class MemoryDocumentIndexFieldsMap
- java.lang.Object
-
- org.terrier.realtime.memory.MemoryDocumentIndex
-
- org.terrier.realtime.memory.MemoryDocumentIndexMap
-
- org.terrier.realtime.memory.fields.MemoryDocumentIndexFieldsMap
-
- All Implemented Interfaces:
java.io.Serializable
,DocumentIndex
,FieldDocumentIndex
public class MemoryDocumentIndexFieldsMap extends MemoryDocumentIndexMap implements FieldDocumentIndex
A memory document index structure that supports fields and fast lookups via a map structure.- Since:
- 4.0
- Author:
- Stuart Mackie, Richard McCreadie
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.terrier.realtime.memory.MemoryDocumentIndexMap
MemoryDocumentIndexMap.DocumentMapIterator2
-
Nested classes/interfaces inherited from class org.terrier.realtime.memory.MemoryDocumentIndex
MemoryDocumentIndex.DocumentIterator, MemoryDocumentIndex.DocumentIterator2
-
-
Field Summary
-
Fields inherited from class org.terrier.realtime.memory.MemoryDocumentIndex
docLengths
-
-
Constructor Summary
Constructors Constructor Description MemoryDocumentIndexFieldsMap()
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addDocument(int docid, int length, int[] flengths)
Add document length and field lengths to document index.void
addDocument(int docid, int length, int[] flengths, BitIndexPointer bitbasedpointer)
Add document length and field lengths to document index.void
close()
FieldDocumentIndexEntry
getDocumentEntry(int docid)
Return the document index entry based on its docid.int[]
getFieldLengths(int docid)
Get the length of each field-
Methods inherited from class org.terrier.realtime.memory.MemoryDocumentIndexMap
addDocument, addDocument, getDocumentLength, getNumberOfDocuments, iterator, iteratorOverEntries
-
Methods inherited from class org.terrier.realtime.memory.MemoryDocumentIndex
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 docid, int length, int[] flengths)
Add document length and field lengths to document index.
-
addDocument
public void addDocument(int docid, int length, int[] flengths, BitIndexPointer bitbasedpointer)
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 FieldDocumentIndexEntry getDocumentEntry(int docid)
Return the document index entry based on its docid.- Specified by:
getDocumentEntry
in interfaceDocumentIndex
- Overrides:
getDocumentEntry
in classMemoryDocumentIndexMap
- Returns:
- the document index entry based on its docid.
-
close
public void close()
- Overrides:
close
in classMemoryDocumentIndexMap
-
-