|
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.FilePosition
public class FilePosition
Models a position within a file as the offset in bytes and the offset in bits in that byte. For example, an instance of the class FilePosition that points to the 10th bit of a file should be constructed with a byte offset of 1 and a bit offset of 2.
Field Summary | |
---|---|
byte |
Bits
The offset in bits within the pointed byte. |
long |
Bytes
The offset within a file in bytes. |
Constructor Summary | |
---|---|
FilePosition()
Default constructor. |
|
FilePosition(byte[] in)
Create an instance based on a byte buffer |
|
FilePosition(FilePosition in)
Create a new FilePosition based on an existing one |
|
FilePosition(long bytesPosition,
byte bitsPosition)
Creates an instance of the class from the given byte and bit offsets. |
Method Summary | |
---|---|
void |
build(java.io.DataInput di)
unseralize this object from the named dataoutput instance |
boolean |
equals(java.lang.Object o)
Is this FilePosition equal to another? |
int |
hashCode()
Define a hashcode for this - objects which defined equals(Object) should define hashCode() also |
static int |
sizeInBytes()
How large is this object when serialized |
void |
toBytes(java.io.DataOutput dai)
Seralize this object to the named dataoutput instance |
java.lang.String |
toString()
String representation of this object |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public long Bytes
public byte Bits
Constructor Detail |
---|
public FilePosition()
public FilePosition(long bytesPosition, byte bitsPosition)
bytesPosition
- long the given byte offset.bitsPosition
- byte the given bit offset.public FilePosition(byte[] in)
public FilePosition(FilePosition in)
Method Detail |
---|
public static int sizeInBytes()
public void toBytes(java.io.DataOutput dai)
public void build(java.io.DataInput di)
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
Terrier IR Platform 2.2.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |