public class MemoryDocumentIndex extends Object implements DocumentIndex, Serializable
Modifier and Type | Class and Description |
---|---|
class |
MemoryDocumentIndex.DocumentIterator
Document index iterator.
|
class |
MemoryDocumentIndex.DocumentIterator2
Document index iterator, iterates over DocumentIndexEntry only, not Entry
|
Modifier and Type | Field and Description |
---|---|
gnu.trove.TIntArrayList |
docLengths |
Constructor and Description |
---|
MemoryDocumentIndex()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addDocument(int length)
Add document length to document index.
|
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.
|
void |
setLength(int docid,
int newLength) |
public void addDocument(int length)
public void setLength(int docid, int newLength)
public DocumentIndexEntry getDocumentEntry(int docid) throws IOException
getDocumentEntry
in interface DocumentIndex
IOException
public int getDocumentLength(int docid) throws IOException
getDocumentLength
in interface DocumentIndex
IOException
public int getNumberOfDocuments()
getNumberOfDocuments
in interface DocumentIndex
public Iterator<Map.Entry<Integer,DocumentIndexEntry>> iteratorOverEntries()
public Iterator<DocumentIndexEntry> iterator()
Terrier Information Retrieval Platform 5.1. Copyright © 2004-2019, University of Glasgow