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 int
getDocumentLength()
Return the length of the document.byte
getFileNumber()
Returns the file number (byte value in the 0-31 range)int
getNumberOfEntries()
Return the number of "things" that this pointer refers to.long
getOffset()
Return the number of bytes offset.byte
getOffsetBits()
Return the number of bits offset.void
setDocumentLength(int l)
Set the length of the document.void
setFileNumber(byte fileId)
Set the file number.void
setOffset(long _bytes, byte _bits)
Set the offset in number of bytes and number of bits.java.lang.String
toString()
-
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:
getNumberOfEntries
in interfacePointer
- Returns:
- the number of "things" that this pointer refers to.
-
getOffsetBits
public byte getOffsetBits()
Return the number of bits offset.- Specified by:
getOffsetBits
in interfaceBitFilePosition
- Returns:
- the number of bits offset.
-
getOffset
public long getOffset()
Return the number of bytes offset.- Specified by:
getOffset
in interfaceBitFilePosition
- Returns:
- the number of bytes offset.
-
getFileNumber
public byte getFileNumber()
Returns the file number (byte value in the 0-31 range)- Specified by:
getFileNumber
in interfaceBitIndexPointer
- Returns:
- the file number (byte value in the 0-31 range)
-
setFileNumber
public void setFileNumber(byte fileId)
Set the file number.- Specified by:
setFileNumber
in 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:
setOffset
in interfaceBitFilePosition
- Parameters:
_bytes
- the number of bytes to set._bits
- the number of bits to set.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-