|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--org.metastatic.rsync.Offsets
This class represents an update to a file or array of bytes wherein the bytes themselves have not changed, but have moved to another location. This is represented by three fields: the offset in the original data, the offset in the new data, and the length, in bytes, of this block.
| Field Summary | |
|---|---|
protected int |
blockLength
The size of the moved block, in bytes. |
protected long |
newOffset
The new offset. |
protected long |
oldOffset
The original offset. |
| Constructor Summary | |
|---|---|
Offsets(long oldOffset,
long newOffset,
int blockLength)
Create a new pair of offsets. |
|
| Method Summary | |
|---|---|
boolean |
equals(Object o)
Test if one object is equal to this one. |
int |
getBlockLength()
The size of the block of data this class represents. |
long |
getNewOffset()
Get the updated offset. |
long |
getOldOffset()
Get the original offset. |
long |
getWriteOffset()
Get the offset at which this Delta should be written. |
int |
hashCode()
Returns the hash code of this object, defined as: oldOffset + newOffset + blockLength
% 2^32
|
void |
setBlockLength(int len)
Set the block size. |
void |
setNewOffset(long off)
Set the updated offset. |
void |
setOldOffset(long off)
Set the original offset. |
String |
toString()
Return a String representation of this object. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected long oldOffset
protected long newOffset
protected int blockLength
| Constructor Detail |
public Offsets(long oldOffset,
long newOffset,
int blockLength)
Delta represents original data
that has simply moved in the new data.
oldOffset - The offset in the original data.newOffset - The offset in the new data.blockLength - The size, in bytes, of the block that has moved.| Method Detail |
public long getWriteOffset()
Delta
getWriteOffset in interface Deltapublic int getBlockLength()
Delta
getBlockLength in interface Deltapublic long getOldOffset()
public void setOldOffset(long off)
off - The new value for the original offset.public long getNewOffset()
public void setNewOffset(long off)
off - The new value for the updated offset.public void setBlockLength(int len)
len - The new value for the block size.public String toString()
String representation of this object.
toString in class Objectpublic boolean equals(Object o)
equals in class ObjectoldOffset, newOffset, and blockLength fields are all equal.
ClassCastException - If o is not an
instance of this class.
NullPointerException - If o is null.public int hashCode()
oldOffset+newOffset+blockLength% 2^32
hashCode in class Object
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||