LSExternalArgumentValues Class¶
- class localsolver.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¶
Returns the number of values in the current argument values. |
|
Returns true if the value at the given position is a boolean. |
|
Returns true if the value at the given position is an integer. |
|
Returns true if the value at the given position is a double. |
|
Returns true if the value at the given position is a collection (list or set). |
|
Returns true if the value at the given position is an array. |
|
Returns the value at the given position. |
Returns the number of values in the current argument values. |
|
Returns the value at the given position. |
Instance methods¶
- LSExternalArgumentValues.count()¶
Returns the number of values in the current argument values.
- LSExternalArgumentValues.is_bool(pos)¶
Returns true if the value at the given position is a boolean. You can retrieve the value with
get()
.- Parameters
pos – Position of the value to query.
- Returns
True if the value at the given position is a boolean.
- Return type
bool
- LSExternalArgumentValues.is_int(pos)¶
Returns true if the value at the given position is an integer. You can retrieve the value with
get()
.- Parameters
pos – Position of the value to query.
- Returns
True if the value at the given position is an integer.
- Return type
bool
- LSExternalArgumentValues.is_double(pos)¶
Returns true if the value at the given position is a double. You can retrieve the value with
get()
.- Parameters
pos – Position of the value to query.
- Returns
True if the value at the given position is a double.
- Return type
bool
- LSExternalArgumentValues.is_collection(pos)¶
Returns true if the value at the given position is a collection (list or set). You can retrieve the value with
get()
.- Parameters
pos – Position of the value to query.
- Returns
True if the value at the given position is an array.
- Return type
bool
- LSExternalArgumentValues.is_array(pos)¶
Returns true if the value at the given position is an array. You can retrieve the value with
get()
.- Parameters
pos – Position of the value to query.
- Returns
True if the value at the given position is an array.
- Return type
bool
- LSExternalArgumentValues.get(pos)¶
Returns the value at the given position. The returned value can be a double, integer,
LSArray
orLSCollection
depending on the type of the value.- Parameters
pos – Position of the value to query.
- Returns
Value
- Return type
int
,double
,LSArray
orLSCollection
Special operators and methods¶
- LSExternalArgumentValues.__len__()¶
Returns the number of values in the current argument values. This method allows users to call
len()
function directly on the external argument values without using thecount()
method.
- LSExternalArgumentValues.__getitem__(pos)¶
Returns the value at the given position. This method allows users to use
[]
operator directly on the external argument values without using theget()
method.- Parameters
pos – Position of the value to query.
- Returns
Value
- Return type
int
,double
,LSArray
orLSCollection