java.lang.Object
org.bzdev.util.JSArray
org.bzdev.util.ExpressionParser.ESPArray
- Enclosing class:
- ExpressionParser
ExpressionParser/ESP array.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bzdev.util.JSArray
JSArray.ConversionException
-
Method Summary
Modifier and TypeMethodDescriptiontoJavaArray
(Class<?> clasz) Convert this object to a Java array.toJavaMatrix
(Class<?> clasz) Convert this object to a Java matrix (an n by m Java array).Create astream
of a specified type backed by this object.Methods inherited from class org.bzdev.util.JSArray
add, add, add, add, add, add, addObject, forEach, get, get, identity, iterator, parallelStream, set, setObject, size, spliterator, stream, toArray, toArray, toBooleanArray, toBooleanMatrix, toDoubleArray, toDoubleMatrix, toIntArray, toIntMatrix, toKeyMapList, toKeyMapList, toLongArray, toLongMatrix, toMatrix, toMatrix
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.bzdev.util.JSOps
nextIdentity
-
Method Details
-
toJavaArray
Convert this object to a Java array.Note: this method is used internally by
ExpressionParser
. While it can be called directly, in most cases the methodsJSArray.toArray(Class)
,JSArray.toDoubleArray()
,JSArray.toLongArray()
,JSArray.toIntArray()
, areJSArray.toBooleanArray()
are better choices as these methods' return types are arrays of the appropriate type.- Parameters:
clasz
- the component type of the array (the primitive types double, long, int, and boolean are recognized in addition to non-primitive class names)- Returns:
- the array
-
toStream
Create astream
of a specified type backed by this object. The argument determines the type of the stream created: for- int.class, the stream is an
IntStream
. - long.class,
LongStream
. - double.class,
DoubleStream
.
- Parameters:
clasz
- either int.class, long.class, or double.class- Returns:
- the stream
- Throws:
IllegalArgumentException
- if the argument is not a recognized classNullPointerException
- if the argument is null
- int.class, the stream is an
-
toJavaMatrix
Convert this object to a Java matrix (an n by m Java array).Note: this method is used internally by
ExpressionParser
. While it can be called directly, in most cases the methodsJSArray.toMatrix(Class)
,JSArray.toDoubleMatrix()
,JSArray.toLongMatrix()
,JSArray.toIntMatrix()
, andJSArray.toBooleanMatrix()
are better choices as these methods' return types are matrices (e.g., arrays of arrays) of the appropriate type.- Parameters:
clasz
- the component type of the array (the primitive types double, long, int, and boolean are recognized in addition to non-primitive class names)- Returns:
- the matrix
-