public class MemoryDocumentIndexMap extends MemoryDocumentIndex
Modifier and Type | Class and Description |
---|---|
class |
MemoryDocumentIndexMap.DocumentMapIterator2
Document index iterator, iterates over DocumentIndexEntry only.
|
MemoryDocumentIndex.DocumentIterator, MemoryDocumentIndex.DocumentIterator2
docLengths
Constructor and Description |
---|
MemoryDocumentIndexMap()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addDocument(int length)
Add document length to document index.
|
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.
|
setLength
public void addDocument(int docid, int length)
public void addDocument(int length)
MemoryDocumentIndex
addDocument
in class MemoryDocumentIndex
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 Information Retrieval Platform 5.1. Copyright © 2004-2019, University of Glasgow