Package com.igormaznitsa.jbbp.model
Class JBBPFieldArrayLong
java.lang.Object
com.igormaznitsa.jbbp.model.JBBPAbstractField
com.igormaznitsa.jbbp.model.JBBPAbstractArrayField<JBBPFieldLong>
com.igormaznitsa.jbbp.model.JBBPFieldArrayLong
- All Implemented Interfaces:
JBBPNamedField,JBBPNumericArray,Serializable,Iterable<JBBPFieldLong>
public final class JBBPFieldArrayLong
extends JBBPAbstractArrayField<JBBPFieldLong>
implements JBBPNumericArray
Describes a long array.
- 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 TypeMethodDescriptionlong[]getArray()get the value arraybooleangetAsBool(int index) Get element as boolean.intgetAsInt(int index) Get element as integer.longgetAsLong(int index) Get element as long.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
-
JBBPFieldArrayLong
The Constructor.- Parameters:
name- a field name info, it can be nullarray- a value array, it must not be null
-
-
Method Details
-
getArray
public long[] getArray()get the value array- Returns:
- the value array as a long array
-
size
public int size()Description copied from class:JBBPAbstractArrayFieldGet number of elements in the array.- Specified by:
sizein classJBBPAbstractArrayField<JBBPFieldLong>- Returns:
- the array size
-
getElementAt
Description copied from class:JBBPAbstractArrayFieldGet element from the array for its index.- Specified by:
getElementAtin classJBBPAbstractArrayField<JBBPFieldLong>- Parameters:
index- the array index- Returns:
- the array element for its index
-
getAsInt
public int getAsInt(int index) Description copied from interface:JBBPNumericArrayGet element as integer.- Specified by:
getAsIntin interfaceJBBPNumericArray- Parameters:
index- index of element in array- Returns:
- the element as integer
-
getAsLong
public long getAsLong(int index) Description copied from interface:JBBPNumericArrayGet element as long.- Specified by:
getAsLongin interfaceJBBPNumericArray- Parameters:
index- index of element in array- Returns:
- the element as long
-
getAsBool
public boolean getAsBool(int index) Description copied from interface:JBBPNumericArrayGet element as boolean.- Specified by:
getAsBoolin interfaceJBBPNumericArray- Parameters:
index- index of element in array- Returns:
- the element as boolean
-
getValueArrayAsObject
Description copied from class:JBBPAbstractArrayFieldGet the value array as an object.- Specified by:
getValueArrayAsObjectin classJBBPAbstractArrayField<JBBPFieldLong>- 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]'
-