step
Class StepData

java.lang.Object
  |
  +--step.StepData
All Implemented Interfaces:
Serializable, StepObject

public class StepData
extends Object
implements StepObject

Implementation of the built-in STEP data type.

See Also:
Serialized Form

Field Summary
static FieldDef LENGTH_FIELD
           
static Type TYPE
          The STEP type for data objects.
 
Constructor Summary
StepData(byte[] data)
          Create a new data object from an array of bytes.
 
Method Summary
 boolean equals(Object o)
          Compare two data objects for equality.
 byte[] getData()
          Get the underlying byte data for this object.
 int hashCode()
          Get the hash-code for this object.
 String toString()
          Get a text version of this data object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

TYPE

public static final Type TYPE
The STEP type for data objects.


LENGTH_FIELD

public static final FieldDef LENGTH_FIELD
Constructor Detail

StepData

public StepData(byte[] data)
Create a new data object from an array of bytes.

Method Detail

getData

public byte[] getData()
Get the underlying byte data for this object.


equals

public boolean equals(Object o)
Compare two data objects for equality.

The objects are equivalent if their data are the same size and contain the same values.

The algorithm is fail-fast.

Specified by:
equals in interface StepObject
Overrides:
equals in class Object

hashCode

public int hashCode()
Get the hash-code for this object.

Algorithm:

 for (i=0; i<value.length; i++)
   code = (code << 1) ^ (hashCode[i]);
 

Specified by:
hashCode in interface StepObject
Overrides:
hashCode in class Object
See Also:
equals(Object)

toString

public String toString()
Get a text version of this data object.

The output is a list of byte values in hexadecimal.

Overrides:
toString in class Object
See Also:
Hex.toString(byte[])