Package org.terrier.structures
Class SimpleDocumentIndexEntry
- java.lang.Object
-
- org.terrier.structures.DocumentIndexEntry
-
- org.terrier.structures.SimpleDocumentIndexEntry
-
- All Implemented Interfaces:
org.apache.hadoop.io.Writable,BitFilePosition,BitIndexPointer,Pointer
public class SimpleDocumentIndexEntry extends DocumentIndexEntry
A document index entry that doesn't write out direct index offset.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSimpleDocumentIndexEntry.FactoryFactory for the creation of DocumentIndexEntry objects
-
Field Summary
-
Fields inherited from interface org.terrier.structures.BitIndexPointer
BIT_MASK, FILE_SHIFT, MAX_FILE_ID
-
-
Constructor Summary
Constructors Constructor Description SimpleDocumentIndexEntry()Construct an instance of the class.SimpleDocumentIndexEntry(DocumentIndexEntry die)Construct an instance of the class with
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description bytegetFileNumber()Returns the file number (byte value in the 0-31 range)java.lang.StringpointerToString()Returns a textual representation of the pointer alonevoidreadFields(java.io.DataInput in)voidsetBitIndexPointer(BitIndexPointer pointer)Update this pointer to reflect the same values as the specified pointervoidsetFileNumber(byte fileId)Set the file number.voidsetNumberOfEntries(int n)Set the number of "things" that the pointer refers to.voidsetOffset(BitFilePosition pos)Sets the bit file position within this object to that represented by the specified bit file position.voidsetPointer(Pointer p)Sets the pointer within this object to that represented by the specified pointer.voidwrite(java.io.DataOutput out)-
Methods inherited from class org.terrier.structures.DocumentIndexEntry
getDocumentLength, getNumberOfEntries, getOffset, getOffsetBits, setDocumentLength, setOffset, toString
-
-
-
-
Constructor Detail
-
SimpleDocumentIndexEntry
public SimpleDocumentIndexEntry()
Construct an instance of the class.
-
SimpleDocumentIndexEntry
public SimpleDocumentIndexEntry(DocumentIndexEntry die)
Construct an instance of the class with- Parameters:
die-
-
-
Method Detail
-
setNumberOfEntries
public void setNumberOfEntries(int n)
Set the number of "things" that the pointer refers to.- Parameters:
n- the number of "things" that the pointer refers to.
-
setOffset
public void setOffset(BitFilePosition pos)
Sets the bit file position within this object to that represented by the specified bit file position. Does nothing in this implementation- Parameters:
pos- other bit file position to update the bit file position in this object.
-
setBitIndexPointer
public void setBitIndexPointer(BitIndexPointer pointer)
Update this pointer to reflect the same values as the specified pointer Does nothing in this implementation- Parameters:
pointer- the pointer to use to set the byte offset, bit offset and file number parameters.
-
readFields
public void readFields(java.io.DataInput in) throws java.io.IOException- Throws:
java.io.IOException
-
write
public void write(java.io.DataOutput out) throws java.io.IOException- Throws:
java.io.IOException
-
pointerToString
public java.lang.String pointerToString()
Returns a textual representation of the pointer alone
-
setPointer
public void setPointer(Pointer p)
Sets the pointer within this object to that represented by the specified pointer. Does nothing in this implementation- Parameters:
p- other pointer to update the pointer in this object.
-
getFileNumber
public byte getFileNumber()
Returns the file number (byte value in the 0-31 range)- Specified by:
getFileNumberin interfaceBitIndexPointer- Overrides:
getFileNumberin classDocumentIndexEntry- Returns:
- the file number (byte value in the 0-31 range)
-
setFileNumber
public void setFileNumber(byte fileId)
Set the file number. Does nothing in this implementation- Specified by:
setFileNumberin interfaceBitIndexPointer- Overrides:
setFileNumberin classDocumentIndexEntry- Parameters:
fileId- the file number.
-
-