|
Terrier IR Platform 2.2.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object uk.ac.gla.terrier.structures.DocumentIndexInputStream
public class DocumentIndexInputStream
This class provides access to the document index file sequentially, as a stream. Each entry in the document index consists of a document id, the document number, and the length of the document, that is the number of terms that make up the document.
Constructor Summary | |
---|---|
DocumentIndexInputStream()
A default constructor of a document index, from a given filename. |
|
DocumentIndexInputStream(java.io.File file)
A constructor of a document index, from a given filename. |
|
DocumentIndexInputStream(java.io.InputStream is)
A constructor for the class. |
|
DocumentIndexInputStream(java.lang.String filename)
A constructor of a document index, from a given filename. |
|
DocumentIndexInputStream(java.lang.String path,
java.lang.String prefix)
A constructor of a document index input stream from an index path and prefix. |
Method Summary | |
---|---|
void |
close()
Closes the stream. |
int |
getDocumentId()
Returns the document's id for the given docno. |
int |
getDocumentLength()
Return the length of the document with the given docno. |
java.lang.String |
getDocumentNumber()
Reading the docno for the i-th document. |
byte |
getEndBitOffset()
Returns the bit offset in the ending byte in the direct file's entry for this document |
long |
getEndOffset()
Returns the offset of the ending byte in the direct file for this document |
byte |
getStartBitOffset()
Return the bit offset in the starting byte in the entry in the direct file for this document. |
long |
getStartOffset()
Return the starting byte in the direct file for this document. |
void |
print()
Prints out to the standard error stream the contents of the document index file. |
int |
readNextEntry()
Reads the next entry from the stream. |
void |
setDocnoEntryLength(int l)
Set the length of docnos in the index file |
void |
setIndex(Index i)
This structure can be configured by the Index object. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DocumentIndexInputStream(java.io.InputStream is)
is
- java.io.InputStream The underlying input streampublic DocumentIndexInputStream(java.lang.String filename)
filename
- java.lang.String The name of the document index file.public DocumentIndexInputStream()
public DocumentIndexInputStream(java.io.File file)
file
- java.io.File The document index file.public DocumentIndexInputStream(java.lang.String path, java.lang.String prefix)
path
- String path to the indexprefix
- String prefix of the filenames of the indexMethod Detail |
---|
public void setIndex(Index i)
setIndex
in interface IndexConfigurable
i
- Index object to usepublic void setDocnoEntryLength(int l)
public void close()
public int readNextEntry() throws java.io.IOException
java.io.IOException
- if an I/O error occurs.public void print()
public int getDocumentId()
public int getDocumentLength()
public java.lang.String getDocumentNumber()
public byte getEndBitOffset()
public long getEndOffset()
public byte getStartBitOffset()
public long getStartOffset()
|
Terrier IR Platform 2.2.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |