HxmValue Class

class Hexaly.Modeler.HxmValue

General value container. Any value can be contained in an instance of this class (integer, double, boolean, string, HxExpression, module, map, function, class, and also non exposed types like files or dates).

Since:10.0

Summary

Methods
GetValueType Returns the type of the value.
IsObject Returns true if the value is an object (i.
IsNil Returns true if the value is a nil value.
IsInt Returns true if the value is an integer value.
IsDouble Returns true if the value is a double value.
IsBool Returns true if the value is a boolean value.
IsString Returns true if the value is a string value.
IsExpression Returns true if the value is a HxExpression.
IsFunction Returns true if the value is a HxmFunction.
IsModule Returns true if the value is a HxmModule.
IsMap Returns true if the value is a HxmMap.
IsClass Returns true if the value is a HxmClass.
AsInt Returns the value as an integer.
AsDouble Returns the value as a double.
AsBool Returns the value as a boolean.
AsString Returns the value as a string.
AsExpression Returns the value as an expression.
AsFunction Returns the value as a function.
AsModule Returns the value as a module.
AsClass Returns the value as a class.
AsMap Returns the value as a map.
GetClass Returns the class of this object.
Dispose Releases the reference.

Instance methods

HxmType GetValueType()

Returns the type of the value.

Returns:The type of the value.
Return type:HxmType
bool IsObject()

Returns true if the value is an object (i.e. not nil, bool, int or double).

bool IsNil()

Returns true if the value is a nil value.

bool IsInt()

Returns true if the value is an integer value.

bool IsDouble()

Returns true if the value is a double value.

bool IsBool()

Returns true if the value is a boolean value.

bool IsString()

Returns true if the value is a string value.

bool IsExpression()

Returns true if the value is a HxExpression.

bool IsFunction()

Returns true if the value is a HxmFunction.

bool IsModule()

Returns true if the value is a HxmModule.

bool IsMap()

Returns true if the value is a HxmMap.

bool IsClass()

Returns true if the value is a HxmClass.

long AsInt()

Returns the value as an integer. The value must be an integer.

Returns:Integer value.
Return type:long
double AsDouble()

Returns the value as a double. The value must be a double.

Returns:Double value.
Return type:double
bool AsBool()

Returns the value as a boolean. The value must be a boolean.

Returns:Boolean value.
Return type:bool
string AsString()

Returns the value as a string. The value must be a string.

Returns:String value.
Return type:string
Hexaly.Optimizer.HxExpression AsExpression()

Returns the value as an expression. The value must be a Hexaly.Optimizer.HxExpression.

Returns:Expression value.
Return type:HxExpression
HxmFunction AsFunction()

Returns the value as a function. The value must be a HxmFunction.

Returns:Function value.
Return type:HxmFunction
HxmModule AsModule()

Returns the value as a module. The value must be a HxmModule.

Returns:Module value.
Return type:HxmModule
HxmClass AsClass()

Returns the value as a class. The value must be a HxmClass.

Since:13.0
Returns:Class value.
Return type:HxmClass
HxmMap AsMap()

Returns the value as a map. The value must be a HxmMap.

Returns:Map value.
Return type:HxmMap
HxmClass GetClass()

Returns the class of this object. The value must be an object (i.e. not a boolean, integer, double or nil).

Since:13.0
Returns:Class of this object.
Return type:HxmClass
void Dispose()

Releases the reference. If this value was already released, returns immediately and does nothing. Invoking any method on this object after this operation will throw an exception.

Note: Releasing a reference does not necessarily imply that the underlying value object is destroyed. It is only destroyed if no more references point to it.

Since:11.5