Class JBBPAbstractArrayField<T extends JBBPAbstractField>

java.lang.Object
com.igormaznitsa.jbbp.model.JBBPAbstractField
com.igormaznitsa.jbbp.model.JBBPAbstractArrayField<T>
Type Parameters:
T - type of field which can be contained in the array
All Implemented Interfaces:
JBBPNamedField, Serializable, Iterable<T>
Direct Known Subclasses:
JBBPFieldArrayBit, JBBPFieldArrayBoolean, JBBPFieldArrayByte, JBBPFieldArrayDouble, JBBPFieldArrayFloat, JBBPFieldArrayInt, JBBPFieldArrayLong, JBBPFieldArrayShort, JBBPFieldArrayString, JBBPFieldArrayStruct, JBBPFieldArrayUByte, JBBPFieldArrayUInt, JBBPFieldArrayUShort

public abstract class JBBPAbstractArrayField<T extends JBBPAbstractField> extends JBBPAbstractField implements Iterable<T>
The Class is the ancestor for all field which represent arrays.
Since:
1.0
See Also:
  • Constructor Details

    • JBBPAbstractArrayField

      public JBBPAbstractArrayField(JBBPNamedFieldInfo name)
      The Constructor.
      Parameters:
      name - the name descriptor for the array field, it can be null.
  • Method Details

    • size

      public abstract int size()
      Get number of elements in the array.
      Returns:
      the array size
    • getElementAt

      public abstract T getElementAt(int index)
      Get element from the array for its index.
      Parameters:
      index - the array index
      Returns:
      the array element for its index
    • getValueArrayAsObject

      public abstract Object getValueArrayAsObject(boolean reverseBits)
      Get the value array as an object.
      Parameters:
      reverseBits - reverse bit order in values
      Returns:
      the value array as an object
    • iterator

      public Iterator<T> iterator()
      Generates an iterator to allow the array processing in loops.
      Specified by:
      iterator in interface Iterable<T extends JBBPAbstractField>
      Returns:
      an iterator for the array