Localsolver
5.5
|
Value type for collection expressions (lists).
Such a value is obtained with LSExpression::getCollectionValue(). It represents a reference to the value of a variable and the value of this variable is modified when the LSCollection object if modified.
LSModel LSExpression Since version 5.5
Public Member Functions | |
int | GetIndex () |
Gets the index of the corresponding expression in the model. | |
void | Add (long val) |
Adds the given value to this collection. | |
void | Clear () |
Remove all values of this collection. | |
long | Count () |
Gets the number of values in the collection. | |
long | Get (int position) |
Gets the value at the given position. | |
IEnumerator< long > | GetEnumerator () |
Gets the enumerator for the content of this collection. | |
override string | ToString () |
Returns a string representation of this expression. |
Properties | |
long | this[int key] [get] |
Gets the value at the given position. |
|
inline |
Gets the index of the corresponding expression in the model.
|
inline |
Adds the given value to this collection.
Only allowed in state LSState.Modeling. This function will fail if the given value is outside of the range of the list or if this value is already included in this list (remind that a list cannot contain twice the same value.
val | The value to be added. |
|
inline |
Remove all values of this collection.
Only allowed in state LSState.Modeling.
|
inline |
Gets the number of values in the collection.
|
inline |
Gets the value at the given position.
position | The considered position (must be non negative and striclty smaller than the number of values in the collection). |
|
inline |
Gets the enumerator for the content of this collection.
|
inline |
Returns a string representation of this expression.
This representation provides the index of the expression, its type, and its name (if any). Useful for debugging or logging purposes.
|
get |
Gets the value at the given position.
key | The considered position (must be non negative and striclty smaller than the number of values in the collection). |