org.terrier.structures
Class FSADocumentIndex

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<V>
          extended by org.terrier.structures.collections.FSArrayFile<DocumentIndexEntry>
              extended by org.terrier.structures.FSADocumentIndex
All Implemented Interfaces:
java.io.Closeable, java.lang.Iterable<DocumentIndexEntry>, java.util.Collection<DocumentIndexEntry>, java.util.List<DocumentIndexEntry>, DocumentIndex
Direct Known Subclasses:
FSAFieldDocumentIndex

public class FSADocumentIndex
extends FSArrayFile<DocumentIndexEntry>
implements DocumentIndex

Document Index saved as a fixed size array


Nested Class Summary
static class FSADocumentIndex.FSADocumentIndexIterator
          Gets an iterator over the documents in this index
 
Nested classes/interfaces inherited from class org.terrier.structures.collections.FSArrayFile
FSArrayFile.ArrayFileIterator<V extends org.apache.hadoop.io.Writable>, FSArrayFile.ArrayFileWriter
 
Field Summary
protected  int[] docLengths
           
protected  int lastDocid
           
protected  DocumentIndexEntry lastEntry
           
protected static org.apache.log4j.Logger logger
           
 
Fields inherited from class org.terrier.structures.collections.FSArrayFile
dataFile, dataFilename, entrySize, numberOfEntries, USUAL_EXTENSION, valueFactory
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
  FSADocumentIndex(Index index, java.lang.String structureName)
          Construct an instance of the class with
protected FSADocumentIndex(Index index, java.lang.String structureName, boolean initialise)
           
 
Method Summary
 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
protected  void initialise(Index index, java.lang.String structureName)
           
 
Methods inherited from class org.terrier.structures.collections.FSArrayFile
close, get, iterator, size, writeFSArrayFile
 
Methods inherited from class java.util.AbstractList
add, add, addAll, clear, equals, hashCode, indexOf, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList
 
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray
 

Field Detail

logger

protected static final org.apache.log4j.Logger logger

lastDocid

protected int lastDocid

lastEntry

protected DocumentIndexEntry lastEntry

docLengths

protected int[] docLengths
Constructor Detail

FSADocumentIndex

public FSADocumentIndex(Index index,
                        java.lang.String structureName)
                 throws java.io.IOException
Construct an instance of the class with

Parameters:
index -
structureName -
Throws:
java.io.IOException

FSADocumentIndex

protected FSADocumentIndex(Index index,
                           java.lang.String structureName,
                           boolean initialise)
                    throws java.io.IOException
Throws:
java.io.IOException
Method Detail

initialise

protected void initialise(Index index,
                          java.lang.String structureName)
                   throws java.io.IOException
Throws:
java.io.IOException

getDocumentLength

public final int getDocumentLength(int docid)
                            throws java.io.IOException
Get the length of the document

Specified by:
getDocumentLength in interface DocumentIndex
Throws:
java.io.IOException

getDocumentEntry

public final DocumentIndexEntry getDocumentEntry(int docid)
                                          throws java.io.IOException
Get the document index entry based on its docid

Specified by:
getDocumentEntry in interface DocumentIndex
Throws:
java.io.IOException

getNumberOfDocuments

public int getNumberOfDocuments()
Get the number of documents

Specified by:
getNumberOfDocuments in interface DocumentIndex


Terrier 3.5. Copyright © 2004-2011 University of Glasgow