public class LSArray
extends java.lang.Object
LSExpression.getArrayValue()
or LSSolution.getArrayValue(localsolver.LSExpression)
.
An array contains values of type lsint, lsdouble or LSArray
(for multi-dimensional arrays). Note that it's possible to mix integers
or doubles in the same array.
Arrays are not decisions and cannot be modified.LSSolution
,
LSExpression
Modifier and Type | Method and Description |
---|---|
int |
count()
Returns the number of elements in the array.
|
boolean |
equals(java.lang.Object obj) |
LSArray |
getArrayValue(int pos)
Returns the array value at the given position.
|
double |
getDoubleValue(int pos)
Returns the double value at the given position.
|
long |
getIntValue(int pos)
Returns the integer value at the given position.
|
int |
hashCode() |
boolean |
isArray(int pos)
Returns true if the value at the given position is an array.
|
boolean |
isBool(int pos)
Returns true if the value at the given position is a boolean.
|
boolean |
isDouble(int pos)
Returns true if the value at the given position is a double.
|
boolean |
isInt(int pos)
Returns true if the value at the given position is an integer.
|
java.lang.String |
toString()
Returns a string representation of the values in the array in the format
"{ val0, val1, ..., valN }"
|
public int count()
public boolean isBool(int pos)
getIntValue(int)
.pos
- Position of the value to query.public boolean isInt(int pos)
getIntValue(int)
.pos
- Position of the value to query.public boolean isDouble(int pos)
getDoubleValue(int)
.pos
- Position of the value to query.public boolean isArray(int pos)
getArrayValue(int)
.pos
- Position of the value to query.public long getIntValue(int pos)
pos
- Position of the value to query.public double getDoubleValue(int pos)
pos
- Position of the value to query.public LSArray getArrayValue(int pos)
pos
- Position of the value to query.public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object