|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.arm4.arm40.transaction.ArmInterface
org.arm4.arm40.transaction.ArmToken
public class ArmToken
The ARM Token can be used as an identifer for a transaction using a set of given bytes. These bytes can be coupled with metadata from a transaction to provide an identification scheme for business transactions.
Field Summary | |
---|---|
protected static int |
HASHKEY_MAX
|
protected int |
m_hashkey
|
protected boolean |
m_hashkeyGenerated
|
protected byte[] |
m_tokenData
|
Fields inherited from class org.arm4.arm40.transaction.ArmInterface |
---|
m_errorCode, m_factory |
Constructor Summary | |
---|---|
ArmToken(byte[] dataBytes,
int offset)
Create an ARM Token. |
|
ArmToken(byte[] dataBytes,
int offset,
int length)
Create an ARM Token. |
Method Summary | |
---|---|
protected boolean |
compare(byte[] reference)
compare two ARM Tokens. |
boolean |
copyBytes(byte[] dest)
Copies the token to a byte array that is already allocated. |
boolean |
copyBytes(byte[] dest,
int offset)
Copies the token to a byte array that is already allocated. |
protected byte |
getByte(int offset)
Get a byte at the offset. |
byte[] |
getBytes()
Returns a newly allocated byte array into which the token is copied. |
int |
getLength()
Gets the length of the byte array part. |
int |
hashCode()
|
Methods inherited from class org.arm4.arm40.transaction.ArmInterface |
---|
getErrorCode, getErrorMessage, getFactory, setErrorCode, setFactory |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.opengroup.arm40.transaction.ArmInterface |
---|
getErrorCode, getErrorMessage, setErrorCode |
Field Detail |
---|
protected byte[] m_tokenData
protected int m_hashkey
protected boolean m_hashkeyGenerated
protected static final int HASHKEY_MAX
Constructor Detail |
---|
public ArmToken(byte[] dataBytes, int offset)
dataBytes
- offset
- public ArmToken(byte[] dataBytes, int offset, int length)
dataBytes
- offset
- length
- Method Detail |
---|
public boolean copyBytes(byte[] dest)
ArmToken
copyBytes
in interface ArmToken
dest
- destination byte array. Its length must be greater
than or equal to the length of the token's byte array.
true
if the operation was successful,
false
otherwise. If false
, the contents of
the target array are undetermined. The most likely errors are an
attempt to copy into a null pointer or into an array that is not
long enough to hold the entire token.public boolean copyBytes(byte[] dest, int offset)
ArmToken
copyBytes
in interface ArmToken
dest
- destination byte array. (dest.length-offset)
must be greater than or equal to the length of the token's byte array.offset
- offset in dest
to copying at.
true
if the operation was successful,
false
otherwise. If false
, the contents of
the target array are undetermined. The most likely errors are an
attempt to copy into a null pointer or into an array that is not
long enough to hold the entire token.public byte[] getBytes()
ArmToken
getLength()
and then executing copyBytes()
into the new array. The ARM implementation would typically not keep
a reference to the array, because that would interfere with garbage
collection.
getBytes
in interface ArmToken
public int getLength()
ArmToken
getLength
in interface ArmToken
public int hashCode()
hashCode
in class java.lang.Object
protected boolean compare(byte[] reference)
reference
-
protected byte getByte(int offset)
offset
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |