Package com.igormaznitsa.jbbp.model
Class JBBPFieldArrayStruct
java.lang.Object
com.igormaznitsa.jbbp.model.JBBPAbstractField
com.igormaznitsa.jbbp.model.JBBPAbstractArrayField<JBBPFieldStruct>
com.igormaznitsa.jbbp.model.JBBPFieldArrayStruct
- All Implemented Interfaces:
JBBPNamedField,Serializable,Iterable<JBBPFieldStruct>
Describes a structure array. It doesn't support operations to get an array value as a numeric one.
- Since:
- 1.0
- See Also:
-
Field Summary
Fields inherited from class com.igormaznitsa.jbbp.model.JBBPAbstractField
fieldNameInfo, payload -
Constructor Summary
ConstructorsConstructorDescriptionJBBPFieldArrayStruct(JBBPNamedFieldInfo name, JBBPFieldStruct[] array) The Constructor. -
Method Summary
Modifier and TypeMethodDescriptiongetArray()Get the value array.getElementAt(int index) Get element from the array for its index.Get the field type in string representation.getValueArrayAsObject(boolean reverseBits) Get the value array as an object.intsize()Get number of elements in the array.Methods inherited from class com.igormaznitsa.jbbp.model.JBBPAbstractArrayField
iteratorMethods inherited from class com.igormaznitsa.jbbp.model.JBBPAbstractField
getFieldName, getFieldPath, getNameInfo, getPayload, 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
-
JBBPFieldArrayStruct
The Constructor.- Parameters:
name- a field name info, it can be nullarray- a value array, it must not be null
-
-
Method Details
-
getArray
Get the value array.- Returns:
- the value array as a structure array
-
size
public int size()Description copied from class:JBBPAbstractArrayFieldGet number of elements in the array.- Specified by:
sizein classJBBPAbstractArrayField<JBBPFieldStruct>- Returns:
- the array size
-
getElementAt
Description copied from class:JBBPAbstractArrayFieldGet element from the array for its index.- Specified by:
getElementAtin classJBBPAbstractArrayField<JBBPFieldStruct>- Parameters:
index- the array index- Returns:
- the array element for its index
-
getValueArrayAsObject
Description copied from class:JBBPAbstractArrayFieldGet the value array as an object.- Specified by:
getValueArrayAsObjectin classJBBPAbstractArrayField<JBBPFieldStruct>- Parameters:
reverseBits- reverse bit order in values- Returns:
- the value array as an object
-
getTypeAsString
Description copied from class:JBBPAbstractFieldGet the field type in string representation.- Specified by:
getTypeAsStringin classJBBPAbstractField- Returns:
- the string representation of field type, like 'int', 'long', 'bool [123]'
-