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 ReadOnlyAstArray
getArray
(int index) Return the ith element of the array as a JsonArray.default Boolean
getBoolean
(int index) Return the ith element of the array as a boolean.default Boolean
getBoolean
(int index, Boolean defaultValue) Return the ith element of the array as a boolean.default Double
getDouble
(int index) Return the ith element of the array as a double.default Double
Return the ith element of the array as a double.<V> V
getElement
(int index) Return the ith element of the array.default Integer
getInteger
(int index) Return the ith element of the array as a int.default Integer
getInteger
(int index, Integer defaultValue) Return the ith element of the array as a int.default Long
getLong
(int index) Return the ith element of the array as a long.default Long
Return the ith element of the array as a long.default ReadOnlyAstObject
getObject
(int index) Return the ith element of the array as a JsonObject.default <T> T
getScalar
(int index) default <T> T
getScalar
(int index, T defaultValue) default String
getString
(int index) Return the ith element of the array as a String.default String
Return the ith element of the array as a String.int
Returns the first index of the given value, or -1 if it cannot be found.default boolean
isArray
(int index) default boolean
isNull
(int index) default boolean
isObject
(int index) default boolean
isScalar
(int index) iterator()
int
size()
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:
size
in 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
-