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 SummaryModifier 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.IterableforEach, spliterator
- 
Method Details- 
sizeint size()Length of the array or number of keys of the object- Specified by:
- sizein interface- ReadOnlyAstNode
 
- 
indexOfReturns 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.
- 
isNulldefault boolean isNull(int index) 
- 
isObjectdefault boolean isObject(int index) 
- 
isArraydefault boolean isArray(int index) 
- 
isScalardefault boolean isScalar(int index) 
- 
getObjectReturn the ith element of the array as a JsonObject. If the type is not an object, this can result in runtime errors.
- 
getArrayReturn the ith element of the array as a JsonArray. If the type is not an array, this can result in runtime errors.
- 
getScalardefault <T> T getScalar(int index) 
- 
getScalardefault <T> T getScalar(int index, T defaultValue) 
- 
getBooleanReturn the ith element of the array as a boolean. If the type is not a boolean, this can result in runtime errors.
- 
getBooleanReturn the ith element of the array as a boolean. If the type is not a boolean, this can result in runtime errors.
- 
getStringReturn the ith element of the array as a String. If the type is not a String, this can result in runtime errors.
- 
getStringReturn the ith element of the array as a String. If the type is not a String, this can result in runtime errors.
- 
getIntegerReturn the ith element of the array as a int. If the type is not a int, this can result in runtime errors.
- 
getIntegerReturn the ith element of the array as a int. If the type is not a int, this can result in runtime errors.
- 
getLongReturn the ith element of the array as a long. If the type is not a long, this can result in runtime errors.
- 
getLongReturn the ith element of the array as a long. If the type is not a long, this can result in runtime errors.
- 
getDoubleReturn the ith element of the array as a double. If the type is not a double, this can result in runtime errors.
- 
getDoubleReturn the ith element of the array as a double. If the type is not a double, this can result in runtime errors.
- 
iterator
 
-