Package dev.webfx.platform.ast
Interface ReadOnlyAstArray
- All Superinterfaces:
Iterable<Object>,ReadOnlyAstNode
- All Known Subinterfaces:
AstArray,NativeAstArray
- All Known Implementing Classes:
ConfigArray,ListAstArray,ListBasedAstArray,ReadOnlyAstArrayWrapper
- Author:
- Bruno Salmon
-
Method Summary
Modifier and TypeMethodDescriptiondefault ReadOnlyAstArraygetArray(int index) Return the ith element of the array as a JsonArray.default BooleangetBoolean(int index) Return the ith element of the array as a boolean.default BooleangetBoolean(int index, Boolean defaultValue) Return the ith element of the array as a boolean.default DoublegetDouble(int index) Return the ith element of the array as a double.default DoubleReturn the ith element of the array as a double.<V> VgetElement(int index) Return the ith element of the array.default IntegergetInteger(int index) Return the ith element of the array as a int.default IntegergetInteger(int index, Integer defaultValue) Return the ith element of the array as a int.default LonggetLong(int index) Return the ith element of the array as a long.default LongReturn the ith element of the array as a long.default ReadOnlyAstObjectgetObject(int index) Return the ith element of the array as a JsonObject.default <T> TgetScalar(int index) default <T> TgetScalar(int index, T defaultValue) default StringgetString(int index) Return the ith element of the array as a String.default StringReturn the ith element of the array as a String.intReturns the first index of the given value, or -1 if it cannot be found.default booleanisArray(int index) default booleanisNull(int index) default booleanisObject(int index) default booleanisScalar(int index) iterator()intsize()Length of the array or number of keys of the objectMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
size
int size()Length of the array or number of keys of the object- Specified by:
sizein interfaceReadOnlyAstNode
-
indexOf
Returns the first index of the given value, or -1 if it cannot be found. -
getElement
<V> V getElement(int index) Return the ith element of the array. Most consuming call. -
isNull
default boolean isNull(int index) -
isObject
default boolean isObject(int index) -
isArray
default boolean isArray(int index) -
isScalar
default boolean isScalar(int index) -
getObject
Return the ith element of the array as a JsonObject. If the type is not an object, this can result in runtime errors. -
getArray
Return the ith element of the array as a JsonArray. If the type is not an array, this can result in runtime errors. -
getScalar
default <T> T getScalar(int index) -
getScalar
default <T> T getScalar(int index, T defaultValue) -
getBoolean
Return the ith element of the array as a boolean. If the type is not a boolean, this can result in runtime errors. -
getBoolean
Return the ith element of the array as a boolean. If the type is not a boolean, this can result in runtime errors. -
getString
Return the ith element of the array as a String. If the type is not a String, this can result in runtime errors. -
getString
Return the ith element of the array as a String. If the type is not a String, this can result in runtime errors. -
getInteger
Return the ith element of the array as a int. If the type is not a int, this can result in runtime errors. -
getInteger
Return the ith element of the array as a int. If the type is not a int, this can result in runtime errors. -
getLong
Return the ith element of the array as a long. If the type is not a long, this can result in runtime errors. -
getLong
Return the ith element of the array as a long. If the type is not a long, this can result in runtime errors. -
getDouble
Return the ith element of the array as a double. If the type is not a double, this can result in runtime errors. -
getDouble
Return the ith element of the array as a double. If the type is not a double, this can result in runtime errors. -
iterator
-