public class MemoryDocumentIndexMap extends MemoryDocumentIndex
Modifier and Type | Class and Description |
---|---|
class |
MemoryDocumentIndexMap.DocumentMapIterator2
Document index iterator, iterates over DocumentIndexEntry only, not Entry
|
MemoryDocumentIndex.DocumentIterator, MemoryDocumentIndex.DocumentIterator2
docLengths
Constructor and Description |
---|
MemoryDocumentIndexMap()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addDocument(int docid,
int length)
Add document length to document index.
|
void |
close() |
DocumentIndexEntry |
getDocumentEntry(int docid)
Get the document index entry based on its docid
|
int |
getDocumentLength(int docid)
Get the length of the document
|
int |
getNumberOfDocuments()
Get the number of documents
|
Iterator<DocumentIndexEntry> |
iterator()
Return an iterator over the document index.
|
Iterator<Map.Entry<Integer,DocumentIndexEntry>> |
iteratorOverEntries()
Return an iterator over the document index.
|
addDocument
public void addDocument(int docid, int length)
public DocumentIndexEntry getDocumentEntry(int docid)
getDocumentEntry
in interface DocumentIndex
getDocumentEntry
in class MemoryDocumentIndex
public int getDocumentLength(int docid)
getDocumentLength
in interface DocumentIndex
getDocumentLength
in class MemoryDocumentIndex
public int getNumberOfDocuments()
MemoryDocumentIndex
getNumberOfDocuments
in interface DocumentIndex
getNumberOfDocuments
in class MemoryDocumentIndex
public Iterator<Map.Entry<Integer,DocumentIndexEntry>> iteratorOverEntries()
MemoryDocumentIndex
iteratorOverEntries
in class MemoryDocumentIndex
public Iterator<DocumentIndexEntry> iterator()
MemoryDocumentIndex
iterator
in class MemoryDocumentIndex
public void close()
Terrier 4.0. Copyright © 2004-2014 University of Glasgow