public class SecsFormat10 extends java.lang.Object implements SecsFormat
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
cvsRev |
byte[] |
theData |
Constructor and Description |
---|
SecsFormat10()
Required empty constructor.
|
SecsFormat10(boolean b1)
Construct a SecsFormat10 that has a single byte representing the value of the binary data.
|
SecsFormat10(boolean b1,
boolean b2,
boolean b3,
boolean b4,
boolean b5,
boolean b6,
boolean b7,
boolean b8)
Construct a SecsFormat10 that has a single byte representing the bits passed.
|
SecsFormat10(byte newValue)
Construct a SecsFormat10 that has a single byte representing the byte passed.
|
SecsFormat10(byte[] newValue)
Construct a SecsFormat10 from the byte array passed.
|
SecsFormat10(int newValue)
Construct a SecsFormat10 that has a single byte representing the int passed.
|
SecsFormat10(java.lang.String theString)
This constructor will take either a unsigned byte (value between 0 - 255) or a
hex value (0xAA).
|
Modifier and Type | Method and Description |
---|---|
boolean |
booleanValue()
Returns the boolean representation of the object.
|
boolean |
equals(java.lang.Object secsFormat10)
This method will compare the arrays of two SecsFormat10 objects.
|
SecsFormat[] |
getArray()
This allows for arrays of secsformats (not a list of secsformats).
|
boolean |
getBoolValue()
Returns the boolean representation of the object.
|
byte |
getByteValue()
Returns the first element of array as a byte.
|
double |
getDoubleValue()
Returns the first element of array as a double.
|
float |
getFloatValue()
Returns the first element of array as a float.
|
byte[] |
getFormattedBytes()
Returns an array of bytes suitable for use in a SECS Message.
|
int |
getIntValue()
Returns the first element of array as an int.
|
int |
getLength()
Returns the length of the format.
|
long |
getLongValue()
Returns the first element of array as a long.
|
int |
getNumberOfLengthBytes()
Returns the number of length bytes.
|
short |
getShortValue()
Returns the first element of array as a short.
|
java.lang.String |
getStringValue()
Returns the string representation of the object.
|
void |
setArray(SecsFormat[] newValues)
This allows for a standard way to set arrays of secsformats.
|
void |
setDataFromByteArray(byte[] temp,
int offset,
int length)
Set the variable from an array of bytes.
|
void |
setLength(int newValue)
Sets the length of the format.
|
void |
setNumberOfLengthBytes(int numberOfLengthBytes)
Sets the number of length bytes to send when the format is encoded.
|
java.lang.String |
toString()
Returns the SML string representing this value
|
java.lang.String |
toString(int indentCount)
Returns the indented SML string representing this value.
|
boolean |
zeroLength()
Returns true if the format is zero length.
|
public static final java.lang.String cvsRev
public byte[] theData
public SecsFormat10()
public SecsFormat10(boolean b1)
public SecsFormat10(boolean b1, boolean b2, boolean b3, boolean b4, boolean b5, boolean b6, boolean b7, boolean b8)
public SecsFormat10(byte newValue)
public SecsFormat10(byte[] newValue)
public SecsFormat10(int newValue)
public SecsFormat10(java.lang.String theString)
public boolean booleanValue()
public boolean equals(java.lang.Object secsFormat10)
equals
in class java.lang.Object
public SecsFormat[] getArray()
getArray
in interface SecsFormat
public boolean getBoolValue()
getBoolValue
in interface SecsFormat
public byte getByteValue()
getByteValue
in interface SecsFormat
public double getDoubleValue()
getDoubleValue
in interface SecsFormat
public float getFloatValue()
getFloatValue
in interface SecsFormat
public byte[] getFormattedBytes() throws SecsException
getFormattedBytes
in interface SecsFormat
SecsException
public int getIntValue()
getIntValue
in interface SecsFormat
public int getLength()
SecsFormat
getLength
in interface SecsFormat
public long getLongValue()
getLongValue
in interface SecsFormat
public int getNumberOfLengthBytes()
getNumberOfLengthBytes
in interface SecsFormat
public short getShortValue()
getShortValue
in interface SecsFormat
public java.lang.String getStringValue()
getStringValue
in interface SecsFormat
public void setArray(SecsFormat[] newValues) throws SecsException
setArray
in interface SecsFormat
SecsException
public void setDataFromByteArray(byte[] temp, int offset, int length) throws SecsException
setDataFromByteArray
in interface SecsFormat
SecsException
- thrown if the length of the data array is not sufficient to hold the data.
this will occur if the offset is greater that temp.length or if offset+length is greater than temp.length.
In the first case the data will be invalid. In the second case the data will be valid to the maximum extent
possible, that is temp.length-(length+offet) bytes will be valid.public void setLength(int newValue)
SecsFormat
setLength
in interface SecsFormat
newValue
- the new lengthpublic void setNumberOfLengthBytes(int numberOfLengthBytes) throws java.lang.IllegalArgumentException
setNumberOfLengthBytes
in interface SecsFormat
numberOfLengthBytes
- the new number of length bytes. This should
be 1, 2,3 or -1 to indicate the defaultjava.lang.IllegalArgumentException
- if the value is not 1, 2, 3 or -1public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toString(int indentCount)
toString
in interface SecsFormat
the
- indentationpublic boolean zeroLength()
SecsFormat
zeroLength
in interface SecsFormat
Copyright © 1999-2025 ErgoTech Systems, Inc. All Rights Reserved.