OpenGroup::arm40::Provisional::transaction::IArmToken Interface Reference
An abstract interface serving as a superclass of IArmCorrelator, IArmSystemAddress, and IArmID. More...
Public Member Functions | |
byte[] | getBytes () |
Returns a newly allocated byte array into which the token is copied. | |
int | getLength () |
Gets the length of the byte array part. | |
bool | copyBytes (byte[] dest) |
Copies the token to a byte array that is already allocated. | |
bool | copyBytes (byte[] dest, int offset) |
Copies the token to a byte array that is already allocated. |
Detailed Description
IArmToken
expresses the common part of the above interfaces. It is abstract in the sense that any IArmToken
object returned by any method in this specification satisfies one of the subclass interfaces. Objects of these identify particular entities. These objects contain a byte array data token, plus optionally other identifying data, which together comprise the value of the object. The data token is always immutable. Subclasses of IArmToken
can be thought of as wrappers around the data token.
To make it possible to compare the values of these tokens, and to use these tokens as hashkeys (so that the user can associate data with a particular token), this specification requires that any class implementing any of these types override the methods System.Object.Equals(System.Object) and System.Object.GetHashCode() The behavior of these methods must be the following.
a.equals(b)
returns true
if the ArmToken
objects a
and b
have the same value (internal data is byte-for-byte identical in two objects). That is, a.equals(b)
is true if and only if:
-
a
andb
implement the same interfaceIArmCorrelator
,IArmSystemAddress
, orIArmID
. -
a.getBytes()
andb.getBytes()
would return byte arrays of identical lengths and contents. -
If a subclass of
IArmToken
defines other data values (specifically,IArmSystemAddress
defines a short field namedformat
), these other data values are all identical.
If a.equals(b)==true
, a.hashCode()
and b.hashCode()
will return the same value. The hashCode()
value is implementation-defined. In other words, hashcode values are not necessarily portable. A hashcode generated on one system by one implementation may not equal a hashcode value generated on another system by a different implementation, even if a.equals(b)==true
.
Member Function Documentation
bool OpenGroup::arm40::Provisional::transaction::IArmToken::copyBytes | ( | byte[] | dest | ) |
- Parameters:
-
dest destination byte array. Its length must be greater than or equal to the length of the token's byte array.
- Returns:
true
if the operation was successful,false
otherwise. Iffalse
, 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.
bool OpenGroup::arm40::Provisional::transaction::IArmToken::copyBytes | ( | byte[] | dest, | |
int | offset | |||
) |
- Parameters:
-
dest destination byte array. (dest.length-offset)
must be greater than or equal to the length of the token's byte array.
- Parameters:
-
offset offset in dest
to copying at.
- Returns:
true
if the operation was successful,false
otherwise. Iffalse
, 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.
byte [] OpenGroup::arm40::Provisional::transaction::IArmToken::getBytes | ( | ) |
This is equivalent to creating a byte array of length 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.
- Returns:
- a byte array containing a copy of the token's byte array part.
int OpenGroup::arm40::Provisional::transaction::IArmToken::getLength | ( | ) |
- Returns:
- the size of the byte array part of the token.
The documentation for this interface was generated from the following file:
- opengroup/arm40/provisional/transaction/IArmToken.cs