Class JBBPFieldArrayByte

All Implemented Interfaces:
JBBPNamedField, JBBPNumericArray, Serializable, Iterable<JBBPFieldByte>

public final class JBBPFieldArrayByte extends JBBPAbstractArrayField<JBBPFieldByte> implements JBBPNumericArray
Describes a byte array.
Since:
1.0
See Also:
  • Field Details

    • array

      protected final byte[] array
  • Constructor Details

    • JBBPFieldArrayByte

      public JBBPFieldArrayByte(JBBPNamedFieldInfo name, byte[] array)
      The Constructor.
      Parameters:
      name - the field name info, it can be null.
      array - the values array, it must not be null
  • Method Details

    • getArray

      public byte[] getArray()
      Get the values of the array.
      Returns:
      the values as a byte array
    • size

      public int size()
      Description copied from class: JBBPAbstractArrayField
      Get number of elements in the array.
      Specified by:
      size in class JBBPAbstractArrayField<JBBPFieldByte>
      Returns:
      the array size
    • getElementAt

      public JBBPFieldByte getElementAt(int index)
      Description copied from class: JBBPAbstractArrayField
      Get element from the array for its index.
      Specified by:
      getElementAt in class JBBPAbstractArrayField<JBBPFieldByte>
      Parameters:
      index - the array index
      Returns:
      the array element for its index
    • getAsInt

      public int getAsInt(int index)
      Description copied from interface: JBBPNumericArray
      Get element as integer.
      Specified by:
      getAsInt in interface JBBPNumericArray
      Parameters:
      index - index of element in array
      Returns:
      the element as integer
    • getAsLong

      public long getAsLong(int index)
      Description copied from interface: JBBPNumericArray
      Get element as long.
      Specified by:
      getAsLong in interface JBBPNumericArray
      Parameters:
      index - index of element in array
      Returns:
      the element as long
    • getValueArrayAsObject

      public Object getValueArrayAsObject(boolean reverseBits)
      Description copied from class: JBBPAbstractArrayField
      Get the value array as an object.
      Specified by:
      getValueArrayAsObject in class JBBPAbstractArrayField<JBBPFieldByte>
      Parameters:
      reverseBits - reverse bit order in values
      Returns:
      the value array as an object
    • getTypeAsString

      public String getTypeAsString()
      Description copied from class: JBBPAbstractField
      Get the field type in string representation.
      Specified by:
      getTypeAsString in class JBBPAbstractField
      Returns:
      the string representation of field type, like 'int', 'long', 'bool [123]'
    • getAsBool

      public boolean getAsBool(int index)
      Description copied from interface: JBBPNumericArray
      Get element as boolean.
      Specified by:
      getAsBool in interface JBBPNumericArray
      Parameters:
      index - index of element in array
      Returns:
      the element as boolean