Class JBBPFieldArrayInt

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

public final class JBBPFieldArrayInt extends JBBPAbstractArrayField<JBBPFieldInt> implements JBBPNumericArray
Describes an array of integers.
Since:
1.0
See Also:
  • Constructor Details

    • JBBPFieldArrayInt

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

    • getArray

      public int[] getArray()
      Get values as an integer array.
      Returns:
      values as an integer array
    • size

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

      public JBBPFieldInt getElementAt(int index)
      Description copied from class: JBBPAbstractArrayField
      Get element from the array for its index.
      Specified by:
      getElementAt in class JBBPAbstractArrayField<JBBPFieldInt>
      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
    • 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
    • getValueArrayAsObject

      public Object getValueArrayAsObject(boolean reverseBits)
      Description copied from class: JBBPAbstractArrayField
      Get the value array as an object.
      Specified by:
      getValueArrayAsObject in class JBBPAbstractArrayField<JBBPFieldInt>
      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]'