|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.metastatic.rsync.TwoKeyMap.StrongKey
The stronger of the two keys in this Map
. It is
basically a wrapper around an array of bytes, providing methods
important for using this class as the key in a Map, namely the
hashCode()
and compareTo(java.lang.Object)
methods.
Field Summary | |
---|---|
protected byte[] |
key
The key itself. |
Method Summary | |
---|---|
int |
compareTo(Object o)
Compare this object to another. |
boolean |
equals(Object o)
Test if this key equals another. |
byte[] |
getBytes()
Return the bytes that compose this Key. |
int |
hashCode()
The hash code for this key. |
int |
length()
The length, in bytes, of this key. |
void |
setBytes(byte[] key)
Set the byte array that composes this key. |
String |
toString()
Return a zero-padded hexadecimal string representing this key. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
protected byte[] key
Method Detail |
public byte[] getBytes()
key
, the bytes that compose this key.public void setBytes(byte[] key)
key
- The bytes that will compose this key.public int length()
public String toString()
toString
in class Object
key
.public int hashCode()
key
array.
hashCode
in class Object
public boolean equals(Object o)
Arrays.equals(byte[],byte[])
returns true for
thier key arrays.
equals
in class Object
o
- The object to compare to.
ClassCastException
- If o is not a StrongKey.public int compareTo(Object o)
key
fields are references to the same
array.
key
in this class is null.
key
in o is null (null is always less
than everything).
key
arrays are the same and
their contents are equivalent.
compareTo
in interface Comparable
o
- The key to compare to.
ClassCastException
- If o is not a StrongKey.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |