Package org.terrier.structures
Class BasicDocumentIndexEntry
- java.lang.Object
-
- org.terrier.structures.DocumentIndexEntry
-
- org.terrier.structures.BasicDocumentIndexEntry
-
- All Implemented Interfaces:
org.apache.hadoop.io.Writable
,BitFilePosition
,BitIndexPointer
,Pointer
- Direct Known Subclasses:
FieldDocumentIndexEntry
,NonIncrementalDocumentIndexEntry
public class BasicDocumentIndexEntry extends DocumentIndexEntry
A basic document index entry. Allows the creation of a document index entries.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BasicDocumentIndexEntry.Factory
Returna a factory for creating document index entries
-
Field Summary
-
Fields inherited from interface org.terrier.structures.BitIndexPointer
BIT_MASK, FILE_SHIFT, MAX_FILE_ID
-
-
Constructor Summary
Constructors Constructor Description BasicDocumentIndexEntry()
Constructs an instance of the BasicDocumentIndexEntry.BasicDocumentIndexEntry(int length, byte fileId, long byteOffset, byte bitOffset, int numberOfTerms)
Constructs an instance of the BasicDocumentIndexEntry.BasicDocumentIndexEntry(int length, BitIndexPointer pointer)
Constructs an instance of the BasicDocumentIndexEntry.BasicDocumentIndexEntry(DocumentIndexEntry in)
Constructs an instance of the BasicDocumentIndexEntry.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
pointerToString()
Returns a textual representation of the pointer alonevoid
readFields(java.io.DataInput in)
void
setBitIndexPointer(BitIndexPointer pointer)
Update this pointer to reflect the same values as the specified pointervoid
setNumberOfEntries(int n)
Set the number of "things" that the pointer refers to.void
setOffset(BitFilePosition pos)
Sets the bit file position within this object to that represented by the specified bit file position.void
setPointer(Pointer p)
Sets the pointer within this object to that represented by the specified pointer.void
write(java.io.DataOutput out)
-
Methods inherited from class org.terrier.structures.DocumentIndexEntry
getDocumentLength, getFileNumber, getNumberOfEntries, getOffset, getOffsetBits, setDocumentLength, setFileNumber, setOffset, toString
-
-
-
-
Constructor Detail
-
BasicDocumentIndexEntry
public BasicDocumentIndexEntry()
Constructs an instance of the BasicDocumentIndexEntry.
-
BasicDocumentIndexEntry
public BasicDocumentIndexEntry(DocumentIndexEntry in)
Constructs an instance of the BasicDocumentIndexEntry.- Parameters:
in
-
-
BasicDocumentIndexEntry
public BasicDocumentIndexEntry(int length, BitIndexPointer pointer)
Constructs an instance of the BasicDocumentIndexEntry.- Parameters:
length
-pointer
-
-
BasicDocumentIndexEntry
public BasicDocumentIndexEntry(int length, byte fileId, long byteOffset, byte bitOffset, int numberOfTerms)
Constructs an instance of the BasicDocumentIndexEntry.- Parameters:
length
-fileId
-byteOffset
-bitOffset
-numberOfTerms
-
-
-
Method Detail
-
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
-
setBitIndexPointer
public void setBitIndexPointer(BitIndexPointer pointer)
Update this pointer to reflect the same values as the specified pointer- Parameters:
pointer
- the pointer to use to set the byte offset, bit offset and file number parameters.
-
setOffset
public void setOffset(BitFilePosition pos)
Sets the bit file position within this object to that represented by the specified bit file position.- Parameters:
pos
- other bit file position to update the bit file position in this object.
-
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.
-
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.- Parameters:
p
- other pointer to update the pointer in this object.
-
-