|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectoemware.core.ByteArray
public final class ByteArray
The byte array object. This is a thin wrapper around a byte array
that implements the hash code method and eauals. This is mainly
used for it's comparison features. Null data objects are not allowd.
This uses the length and offset in the equals and hash code.
Some of this code was taken from java.util.Arrays.
| Field Summary | |
|---|---|
byte[] |
data
|
int |
length
|
int |
offset
|
| Constructor Summary | |
|---|---|
ByteArray()
Creates an empty byte array. |
|
ByteArray(byte[] pData)
Create a new byte array with the data. |
|
ByteArray(byte[] pData,
int pOffset,
int pLength)
Create a new byte array with a subset of the byte array. |
|
| Method Summary | |
|---|---|
boolean |
equals(java.lang.Object pObject)
Overrides the default equals to compare the byte array. |
int |
hashCode()
Overrides the default hash code to handle the bye array (or sction of). |
boolean |
isEqual(byte[] pData)
Check to see if the data passed is equal to this value. |
java.lang.String |
toString()
This is for debug only. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public byte[] data
public volatile int length
public volatile int offset
| Constructor Detail |
|---|
public ByteArray()
public ByteArray(byte[] pData)
pData - The byte array.
public ByteArray(byte[] pData,
int pOffset,
int pLength)
pData - The data.pOffset - The offset in the pData array.pLength - the length of the data to use.| Method Detail |
|---|
public final boolean isEqual(byte[] pData)
pData - The data.
public final boolean equals(java.lang.Object pObject)
equals in class java.lang.ObjectpObject - The object to check. May not be null.
public final int hashCode()
hashCode in class java.lang.Objectpublic final java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||