|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.afcs.warts.db.BinaryDataHolder
The BinaryDataHolder class is reponsible for holding
binary column data (which it stores internally as an array of bytes), and
implementing methods like equals(java.lang.Object)
, compareTo(java.lang.Object)
, and
hashCode()
, so that instances can be processed easily.
LICENSE: This code is released to the public domain and may be used for any purpose whatsoever without permission or acknowledgment.
Constructor Summary | |
BinaryDataHolder(byte[] data)
Constructs a new instance to contain the specified binary data, which must not be null. |
Method Summary | |
int |
compareTo(java.lang.Object otherObj)
Compares the specified object to the current instance, returning a number that could be used to sort a list of BinaryDataHolder instances into ascending order, or 0 if the specified object is not a BinaryDataHolder instance. |
boolean |
equals(java.lang.Object otherObj)
Returns true if the specified object is a BinaryDataHolder instance that contains exactly the same binary data as this one. |
byte[] |
getData()
Returns the binary data cached in ths instance. |
int |
hashCode()
Returns a reasonable hashcode derived from the binary data contained within the current instance. |
java.lang.String |
toString()
Returns the first 10 values (or less) of the binary data encoded as hex. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public BinaryDataHolder(byte[] data)
data
- The binary data to store.
java.lang.NullPointerException
- If data is null.Method Detail |
public byte[] getData()
WARNING: changing the contents of the array returned will
change the results of the equals(java.lang.Object)
and hashCode()
methods,
which may disrupt the behaviour of collections containing instances.
public int compareTo(java.lang.Object otherObj)
compareTo
in interface java.lang.Comparable
otherObj
- The object to compare this instance to.
public boolean equals(java.lang.Object otherObj)
otherObj
- The object to compare this instance to.
public int hashCode()
public java.lang.String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |