public class IeBinaryStateInformation extends InformationElement
Constructor and Description |
---|
IeBinaryStateInformation(byte[] value)
Creates a BSI (binary state information) information element from a byte array.
|
IeBinaryStateInformation(int value)
Creates a BSI (binary state information) information element from an integer value.
|
Modifier and Type | Method and Description |
---|---|
boolean |
getBinaryState(int position)
Returns true if the bit at the given position is 1 and false otherwise.
|
int |
getValue()
Returns the 32 binary states of this element as an integer.
|
byte[] |
getValueAsByteArray()
Returns the 32 binary states of this element as a byte array.
|
java.lang.String |
toString() |
public IeBinaryStateInformation(int value)
value
- the bits of value represent the 32 binary states of this element. When encoded in a message, the MSB
of value
is transmitted first and the LSB of value
is transmitted last.public IeBinaryStateInformation(byte[] value)
value
- the bits of value represent the 32 binary states of this element. When encoded in a message, the MSB
of the first byte is transmitted first and the LSB of fourth byte is transmitted last.public int getValue()
public byte[] getValueAsByteArray()
public boolean getBinaryState(int position)
position
- the position in the bit string. Range: 1-32. Position 1 represents the last bit in the encoded message
and is the least significant bit (LSB) of the value returned by getValue()
. Position 32
represents the first bit in the encoded message and is the most significant bit (MSB) of the value
returned by getValue()
.public java.lang.String toString()
toString
in class java.lang.Object