Localsolver  6.0
localsolver.LSNativeContext Class Reference

Detailed Description

Context for native functions.

Native context are used to query the values of the arguments passed to native functions.

Public Member Functions

bool IsBool (int pos)
 Returns true if the value at the given position is a boolean.
bool IsInt (int pos)
 Returns true if the value at the given position is an integer.
bool IsDouble (int pos)
 Returns true if the value at the given position is a double.
long GetIntValue (int pos)
 Returns the integer value at the given position.
double GetDoubleValue (int pos)
 Returns the double value at the given position.
int Count ()
 Returns the number of values in the current context.

Member Function Documentation

bool localsolver.LSNativeContext.IsBool ( int  pos)

Returns true if the value at the given position is a boolean.

You can retrieve the value with GetIntValue.

Parameters
posPosition of the value to query.
Returns
True if the value at the given position is a boolean.
bool localsolver.LSNativeContext.IsInt ( int  pos)

Returns true if the value at the given position is an integer.

You can retrieve the value with GetIntValue.

Parameters
posPosition of the value to query.
Returns
True if the value at the given position is an integer.
bool localsolver.LSNativeContext.IsDouble ( int  pos)

Returns true if the value at the given position is a double.

You can retrieve the value with GetDoubleValue.

Parameters
posPosition of the value to query.
Returns
True if the value at the given position is a double.
long localsolver.LSNativeContext.GetIntValue ( int  pos)

Returns the integer value at the given position.

If the value is neither an integer nor a boolean, an exception is thrown.

Parameters
posPosition of the value to query.
Returns
Integer value.
double localsolver.LSNativeContext.GetDoubleValue ( int  pos)

Returns the double value at the given position.

If the value is not a double, an exception is thrown.

Parameters
posPosition of the value to query.
Returns
Double value.
int localsolver.LSNativeContext.Count ( )

Returns the number of values in the current context.