Package com.igormaznitsa.jbbp.model
Class JBBPFieldArrayString
java.lang.Object
com.igormaznitsa.jbbp.model.JBBPAbstractField
com.igormaznitsa.jbbp.model.JBBPAbstractArrayField<JBBPFieldString>
com.igormaznitsa.jbbp.model.JBBPFieldArrayString
- All Implemented Interfaces:
JBBPNamedField,Serializable,Iterable<JBBPFieldString>
Describes an array of strings.
- Since:
- 1.4.0
- See Also:
-
Field Summary
Fields inherited from class com.igormaznitsa.jbbp.model.JBBPAbstractField
fieldNameInfo, payload -
Constructor Summary
ConstructorsConstructorDescriptionJBBPFieldArrayString(JBBPNamedFieldInfo name, String[] array) The Constructor. -
Method Summary
Modifier and TypeMethodDescriptionString[]getArray()Get the values as a short 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
-
JBBPFieldArrayString
The Constructor.- Parameters:
name- a field name info, it can be null.array- a value array, it must not be null bt can contain null.
-
-
Method Details
-
getArray
Get the values as a short array.- Returns:
- the values as a short array.
-
size
public int size()Description copied from class:JBBPAbstractArrayFieldGet number of elements in the array.- Specified by:
sizein classJBBPAbstractArrayField<JBBPFieldString>- Returns:
- the array size
-
getElementAt
Description copied from class:JBBPAbstractArrayFieldGet element from the array for its index.- Specified by:
getElementAtin classJBBPAbstractArrayField<JBBPFieldString>- 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<JBBPFieldString>- 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]'
-