Package org.terrier.structures
Class DocumentIndexEntry
- java.lang.Object
-
- org.terrier.structures.DocumentIndexEntry
-
- All Implemented Interfaces:
org.apache.hadoop.io.Writable,BitFilePosition,BitIndexPointer,Pointer
- Direct Known Subclasses:
BasicDocumentIndexEntry,MultiDocumentEntry,SimpleDocumentIndexEntry
public abstract class DocumentIndexEntry extends java.lang.Object implements BitIndexPointer, org.apache.hadoop.io.Writable
A document index entry. Also acts as a pointer into the direct index.
-
-
Field Summary
-
Fields inherited from interface org.terrier.structures.BitIndexPointer
BIT_MASK, FILE_SHIFT, MAX_FILE_ID
-
-
Constructor Summary
Constructors Constructor Description DocumentIndexEntry()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetDocumentLength()Return the length of the document.bytegetFileNumber()Returns the file number (byte value in the 0-31 range)intgetNumberOfEntries()Return the number of "things" that this pointer refers to.longgetOffset()Return the number of bytes offset.bytegetOffsetBits()Return the number of bits offset.voidsetDocumentLength(int l)Set the length of the document.voidsetFileNumber(byte fileId)Set the file number.voidsetOffset(long _bytes, byte _bits)Set the offset in number of bytes and number of bits.java.lang.StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.terrier.structures.BitFilePosition
setOffset
-
Methods inherited from interface org.terrier.structures.BitIndexPointer
setBitIndexPointer
-
Methods inherited from interface org.terrier.structures.Pointer
pointerToString, setNumberOfEntries, setPointer
-
-
-
-
Method Detail
-
getDocumentLength
public int getDocumentLength()
Return the length of the document.- Returns:
- the length of the document.
-
setDocumentLength
public void setDocumentLength(int l)
Set the length of the document.- Parameters:
l- the length of the document.
-
getNumberOfEntries
public int getNumberOfEntries()
Return the number of "things" that this pointer refers to.- Specified by:
getNumberOfEntriesin interfacePointer- Returns:
- the number of "things" that this pointer refers to.
-
getOffsetBits
public byte getOffsetBits()
Return the number of bits offset.- Specified by:
getOffsetBitsin interfaceBitFilePosition- Returns:
- the number of bits offset.
-
getOffset
public long getOffset()
Return the number of bytes offset.- Specified by:
getOffsetin interfaceBitFilePosition- Returns:
- the number of bytes offset.
-
getFileNumber
public byte getFileNumber()
Returns the file number (byte value in the 0-31 range)- Specified by:
getFileNumberin interfaceBitIndexPointer- Returns:
- the file number (byte value in the 0-31 range)
-
setFileNumber
public void setFileNumber(byte fileId)
Set the file number.- Specified by:
setFileNumberin interfaceBitIndexPointer- Parameters:
fileId- the file number.
-
setOffset
public void setOffset(long _bytes, byte _bits)Set the offset in number of bytes and number of bits.- Specified by:
setOffsetin interfaceBitFilePosition- Parameters:
_bytes- the number of bytes to set._bits- the number of bits to set.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-