Inherits org.qscript.Token.
Inherited by org.qscript.FlowAction, and org.qscript.Variable.
Public Member Functions | |
Argument (Object v) | |
boolean | equals (Object o) |
Object | getValue () |
boolean | isArgument () |
boolean | isNan () |
Vector | toVector_ () throws EvaluationException |
Vector | toVector () |
Complex | toComplex_ () throws EvaluationException |
Complex | toComplex () |
boolean | toBoolean_ () throws EvaluationException |
boolean | toBoolean () |
double | toDouble_ () throws EvaluationException |
double | toDouble () |
float | toFloat_ () throws EvaluationException |
float | toFloat () |
int | toInteger_ () throws EvaluationException |
int | toInteger () |
String | toString () |
Public Member Functions inherited from org.qscript.Token | |
void | setTextPosition (int charStart, int charWidth) |
void | setTextPosition (int line, int charStart, int charWidth) |
int | getLine () |
int | getCharStart () |
int | getCharWidth () |
boolean | isArgument () |
boolean | isFlowAction () |
boolean | isVariable () |
boolean | isThing () |
boolean | isOperator () |
boolean | isFlowOperator () |
String | forListing () |
Additional Inherited Members | |
Static Public Attributes inherited from org.qscript.Token | |
static final Token | DUMMY = new Argument(null) |
Protected Member Functions inherited from org.qscript.Token | |
Token () | |
Protected Attributes inherited from org.qscript.Token | |
int | line |
int | charStart |
int | charWidth |
An argument represents a dynamically typed un-named value and is used to store the intermediate and final results of an expression evaluation.
Internally a value will either be null or one of these data types :-
When creating an Argument or setting its value, the (new) value to be used will be converted (if necessary) into one of the supported types.
will be converted to Integer
will be converted to Double
char / Character will be converted to String
Any other object type will result in the value being null.
org.qscript.Argument.Argument | ( | Object | v | ) |
Create an Argument to act as the operand for the various operators
v | the value to store in this argument. |
Object org.qscript.Argument.getValue | ( | ) |
Get the value stored in this Argument.
boolean org.qscript.Argument.isArgument | ( | ) |
Returns true
boolean org.qscript.Argument.isNan | ( | ) |
If the value is of type Double and it is Not a Number (NaN) then return true. In all other circumstances return false.
boolean org.qscript.Argument.toBoolean | ( | ) |
Get the Boolean value of the base object if a direct conversion can take place. If the base object cannot be converted to a Boolean then display an error message and return false.
boolean org.qscript.Argument.toBoolean_ | ( | ) | throws EvaluationException |
Get the Boolean interpretation of the base object if a direct conversion can take place.
EvaluationException | if the base object is not a Boolean or cannot be converted to a Boolean |
Complex org.qscript.Argument.toComplex | ( | ) |
Complex org.qscript.Argument.toComplex_ | ( | ) | throws EvaluationException |
double org.qscript.Argument.toDouble | ( | ) |
Get the Double value of the base object if a direct conversion can take place. If the base object cannot be converted to a Double then display an error message and return zero.
double org.qscript.Argument.toDouble_ | ( | ) | throws EvaluationException |
Attempt to convert the base object to a Boolean.
EvaluationException | if the base object cannot be converted to a Boolean Get the Double interpretation of the base object if a direct conversion can take place. |
EvaluationException | if the base object is not a Double or cannot be converted to a Double |
float org.qscript.Argument.toFloat | ( | ) |
Get the Float value of the base object if a direct conversion can take place. If the base object cannot be converted to a Float then display an error message and return zero.
float org.qscript.Argument.toFloat_ | ( | ) | throws EvaluationException |
Attempt to convert the base object to a Double.
EvaluationException | if the base object cannot be converted to a Double Get the Float interpretation of the base object if a direct conversion can take place. |
EvaluationException | if the base object is not a Float or cannot be converted to a Float |
int org.qscript.Argument.toInteger | ( | ) |
Get the Integer value of the base object if a direct conversion can take place. If the base object cannot be converted to an Integer then display an error message and return zero.
int org.qscript.Argument.toInteger_ | ( | ) | throws EvaluationException |
Attempt to convert the base object to a Float.
EvaluationException | if the base object cannot be converted to a Float Get an Integer interpretation of the base object if a direct conversion can take place. |
EvaluationException | if the base object is not an Integer or cannot be converted to an Integer |
String org.qscript.Argument.toString | ( | ) |
Attempt to convert the base object to an Integer.
EvaluationException | if the base object cannot be converted to an Integer Convert the base object to a String. |
Vector org.qscript.Argument.toVector | ( | ) |
Vector org.qscript.Argument.toVector_ | ( | ) | throws EvaluationException |