Class VariableDatum
- All Implemented Interfaces:
Serializable
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected VariableRecordType
Type of variable datum to be transmitted. 32 bit enumeration defined in EBV uid 66protected Integer
Length, IN BITS, of the variable datum.protected byte[]
This field shall specify the value for a particular Variable Datum ID. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
equalsImpl
(Object obj) Compare all fields that contribute to the state, ignoring transient and static fields, forthis
and the supplied objectint
Returns size of this serialized (marshalled) object in bytesGetter forvariableDatumID
int
Getter forvariableDatumLength
byte[]
Getter forvariableDatumValue
int
hashCode()
void
marshal
(DataOutputStream dos) Serializes an object to a DataOutputStream.void
marshal
(ByteBuffer byteBuffer) Packs an object into the ByteBuffer.setVariableDatumID
(VariableRecordType pVariableDatumID) Setter forvariableDatumID
setVariableDatumLengthInBits
(int bitLength) Setter forvariableDatumLength
setVariableDatumLengthInBytes
(int byteLength) Setter forvariableDatumLength
setVariableDatumValue
(byte[] pVariableDatumValue) Setter forvariableDatumValue
toString()
int
unmarshal
(DataInputStream dis) Deserializes an object from a DataInputStream.int
unmarshal
(ByteBuffer byteBuffer) Unpacks a Pdu from the underlying data.
-
Field Details
-
variableDatumID
Type of variable datum to be transmitted. 32 bit enumeration defined in EBV uid 66 -
variableDatumLength
Length, IN BITS, of the variable datum. -
variableDatumValue
protected byte[] variableDatumValueThis field shall specify the value for a particular Variable Datum ID. The field format shall depend on the type of datum as specified by the Variable Datum ID. Variable datums can be any number of bits long.
-
-
Constructor Details
-
VariableDatum
public VariableDatum()Constructor
-
-
Method Details
-
getMarshalledSize
public int getMarshalledSize()Returns size of this serialized (marshalled) object in bytes- Returns:
- serialized size in bytes
- See Also:
-
setVariableDatumID
Setter forvariableDatumID
- Parameters:
pVariableDatumID
- of interest- Returns:
- same object to permit progressive setters
-
getVariableDatumID
-
setVariableDatumLengthInBits
Setter forvariableDatumLength
This value is the size IN BITS of the
variableDatumValue
field. Since that field is a byte array, its size must be large enough to contain the specified number of bits. IfvariableDatumValue
is NOT set and this pdu is issued (marshaled), the value used when marshaling this field will be the size of the byte array times 8.- Parameters:
bitLength
- number of bits for this field- Returns:
- same object to permit progressive setters
-
setVariableDatumLengthInBytes
Setter forvariableDatumLength
This value is the size in bytes of the
variableDatumValue
field. Since that field is a byte array, its size must be large enough to contain the value specified here. IfvariableDatumValue
is NOT set and this pdu is issued (marshaled), the value used when marshaling this field will be the size of the byte array times 8.- Parameters:
byteLength
- number of bytes for this field- Returns:
- same object to permit progressive setters
-
getVariableDatumLength
-
setVariableDatumValue
Setter forvariableDatumValue
This is described in the specification as a stream of bits, but is implemented in Java as a byte array. The size of the byte array reflects the value of
variableDatumLength
rounded to the next highest byte boundary. IfvariableDatumLength
is not set when the Pdu is sent, the receiver will read a bit length equal to the size of the byte array times 8.- Parameters:
pVariableDatumValue
- of interest- Returns:
- same object to permit progressive setters
-
getVariableDatumValue
-
marshal
Serializes an object to a DataOutputStream.- Parameters:
dos
- The DataOutputStream- Throws:
Exception
- if something goes wrong- See Also:
-
unmarshal
Deserializes an object from a DataInputStream.- Parameters:
dis
- DataInputStream- Returns:
- marshalled serialized size in bytes
- Throws:
Exception
- if something goes wrong- See Also:
-
marshal
Packs an object into the ByteBuffer.- Parameters:
byteBuffer
- The ByteBuffer at the position to begin writing- Throws:
BufferOverflowException
- if buff is too smallReadOnlyBufferException
- if buff is read onlyException
- ByteBuffer-generated exception- See Also:
-
unmarshal
Unpacks a Pdu from the underlying data.- Parameters:
byteBuffer
- The ByteBuffer at the position to begin reading- Returns:
- marshalled serialized size in bytes
- Throws:
BufferUnderflowException
- if buff is too smallException
- ByteBuffer-generated exception- See Also:
-
equals
-
hashCode
-
equalsImpl
Compare all fields that contribute to the state, ignoring transient and static fields, forthis
and the supplied object- Parameters:
obj
- the object to compare to- Returns:
- true if the objects are equal, false otherwise.
-
toString
-