LocalSolver logo
is now
Hexaly logo

We're excited to share that we are moving forward. We're leaving behind the LocalSolver brand and transitioning to our new identity: Hexaly. This represents a leap forward in our mission to enable every organization to make better decisions faster when faced with operational and strategic challenges.

This page is for an old version of Hexaly Optimizer. We recommend that you update your version and read the documentation for the latest stable release.

LSExternalArgumentValues Class

class LSExternalArgumentValues

Argument values for external functions. Argument values are used to query the values of the arguments passed to external functions.

Since:9.5

Summary

Functions
count Returns the number of values in the current argument values.
isBool Returns true if the value at the given position is a boolean.
isInt Returns true if the value at the given position is an integer.
isDouble Returns true if the value at the given position is a double.
isCollection Returns true if the value at the given position is a collection (list or set).
isArray Returns true if the value at the given position is an array.
getIntValue Returns the integer value at the given position.
getDoubleValue Returns the double value at the given position.
getCollectionValue Returns the collection value at the given position.
getArrayValue Returns the array value at the given position.

Functions

int LSExternalArgumentValues::count() const

Returns the number of values in the current argument values. Values are indexed from 0 to count() - 1.

bool LSExternalArgumentValues::isBool(int pos) const

Returns true if the value at the given position is a boolean. You can retrieve the value with getIntValue().

Parameters:pos – Position of the value to query.
Returns:True if the value at the given position is a boolean.
bool LSExternalArgumentValues::isInt(int pos) const

Returns true if the value at the given position is an integer. You can retrieve the value with getIntValue().

Parameters:pos – Position of the value to query.
Returns:True if the value at the given position is an integer.
bool LSExternalArgumentValues::isDouble(int pos) const

Returns true if the value at the given position is a double. You can retrieve the value with getDoubleValue().

Parameters:pos – Position of the value to query.
Returns:True if the value at the given position is a double.
bool LSExternalArgumentValues::isCollection(int pos) const

Returns true if the value at the given position is a collection (list or set). You can retrieve the value with getCollectionValue().

Parameters:pos – Position of the value to query.
Returns:True if the value at the given position is a collection.
bool LSExternalArgumentValues::isArray(int pos) const

Returns true if the value at the given position is an array. You can retrieve the value with getArrayValue().

Parameters:pos – Position of the value to query.
Returns:True if the value at the given position is an array.
lsint LSExternalArgumentValues::getIntValue(int pos) const

Returns the integer value at the given position. If the value is neither an integer nor a boolean, an exception is thrown.

Parameters:pos – Position of the value to query.
Returns:Integer value.
lsdouble LSExternalArgumentValues::getDoubleValue(int pos) const

Returns the double value at the given position. If the value is not a double, an exception is thrown.

Parameters:pos – Position of the value to query.
Returns:Double value.
LSCollection LSExternalArgumentValues::getCollectionValue(int pos) const

Returns the collection value at the given position. If the value is not a collection (list or set), an exception is thrown. Note that the returned collection is read only.

Parameters:pos – Position of the value to query.
Returns:Collection value.
LSArray LSExternalArgumentValues::getArrayValue(int pos) const

Returns the array value at the given position. If the value is not an array, an exception is thrown.

Parameters:pos – Position of the value to query.
Returns:Array value.