org.terrier.structures
Class FSADocumentIndex
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<V>
org.terrier.structures.collections.FSArrayFile<DocumentIndexEntry>
org.terrier.structures.FSADocumentIndex
- All Implemented Interfaces:
- Closeable, Iterable<DocumentIndexEntry>, Collection<DocumentIndexEntry>, List<DocumentIndexEntry>, DocumentIndex
- Direct Known Subclasses:
- FSAFieldDocumentIndex
public class FSADocumentIndex
- extends FSArrayFile<DocumentIndexEntry>
- implements DocumentIndex
Document Index saved as a fixed size array
Methods inherited from class java.util.AbstractList |
add, add, addAll, clear, equals, hashCode, indexOf, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList |
logger
protected static final org.apache.log4j.Logger logger
lastDocid
protected int lastDocid
lastEntry
protected DocumentIndexEntry lastEntry
docLengths
protected int[] docLengths
FSADocumentIndex
public FSADocumentIndex(Index index,
String structureName)
throws IOException
- Construct an instance of the class with
- Parameters:
index
- structureName
-
- Throws:
IOException
FSADocumentIndex
protected FSADocumentIndex(Index index,
String structureName,
boolean initialise)
throws IOException
- Throws:
IOException
initialise
protected void initialise(Index index,
String structureName)
throws IOException
- Throws:
IOException
getDocumentLength
public final int getDocumentLength(int docid)
throws IOException
- Get the length of the document
- Specified by:
getDocumentLength
in interface DocumentIndex
- Throws:
IOException
getDocumentEntry
public final DocumentIndexEntry getDocumentEntry(int docid)
throws IOException
- Get the document index entry based on its docid
- Specified by:
getDocumentEntry
in interface DocumentIndex
- Throws:
IOException
getNumberOfDocuments
public int getNumberOfDocuments()
- Get the number of documents
- Specified by:
getNumberOfDocuments
in interface DocumentIndex
Terrier 3.6. Copyright © 2004-2011 University of Glasgow