Package com.igormaznitsa.jbbp.model
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:
-
Field Summary
Fields inherited from class com.igormaznitsa.jbbp.model.JBBPAbstractField
fieldNameInfo, payload -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract TgetElementAt(int index) Get element from the array for its index.abstract ObjectgetValueArrayAsObject(boolean reverseBits) Get the value array as an object.iterator()Generates an iterator to allow the array processing in loops.abstract intsize()Get number of elements in the array.Methods inherited from class com.igormaznitsa.jbbp.model.JBBPAbstractField
getFieldName, getFieldPath, getNameInfo, getPayload, getTypeAsString, setPayloadMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
JBBPAbstractArrayField
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
Get element from the array for its index.- Parameters:
index- the array index- Returns:
- the array element for its index
-
getValueArrayAsObject
Get the value array as an object.- Parameters:
reverseBits- reverse bit order in values- Returns:
- the value array as an object
-
iterator
Generates an iterator to allow the array processing in loops.- Specified by:
iteratorin interfaceIterable<T extends JBBPAbstractField>- Returns:
- an iterator for the array
-