public class LSBlackBoxArgumentValues
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
void |
copyTo(double[] values)
Copy all the double values of the arguments to the given array.
|
void |
copyTo(long[] values)
Copy all the integer values of the argument to the given array.
|
int |
count()
Returns the number of values in the current argument values.
|
boolean |
equals(java.lang.Object obj) |
double |
getDoubleValue(int pos)
Returns the double value at the given position.
|
long |
getIntValue(int pos)
Returns the integer value at the given position.
|
LocalSolver |
getLocalSolver()
Returns the LocalSolver object associated to the argument values.
|
int |
hashCode() |
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.
|
public LocalSolver getLocalSolver()
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 long getIntValue(int pos)
pos
- Position of the value to query.public double getDoubleValue(int pos)
pos
- Position of the value to query.public int count()
public void copyTo(long[] values)
Copy all the integer values of the argument to the given array. Only the integer values are copied to their corresponding position in the array. Cells of the array that correspond to positions of non-integer values in the argument values remain unchanged.
The length of the array can be different from the number of elements in the argument values. In that case, only the elements that fit in the array are copied.
This method is recommended if you need to access all the values of the argument, instead of the roughly equivalent, but less performant, following code:
for(int i = 0; i < Math.min(values.length, argumentValues.count()); ++i) {
if(!argumentValues.isInt(i)) continue;
values[i] = argumentValues.getIntValue(i);
}
values
- array that will receive the integer values of the arguments.public void copyTo(double[] values)
Copy all the double values of the arguments to the given array. Only the double values are copied to their corresponding position in the array. Cells of the array that correspond to positions of non-double values in the arguments remain unchanged.
The length of the array can be different from the number of elements in the arguments values. In that case, only the elements that fit in the array are copied.
This method is recommended if you need to access all the values of the arguments, instead of the roughly equivalent, but less performant, following code:
for(int i = 0; i < Math.min(values.length, argumentValues.count()); ++i) {
if(!argumentValues.isDouble(i)) continue;
values[i] = argumentValues.getDouble(i);
}
values
- array that will receive the double values of the arguments.public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object