Jasmine  1.1
Super fast expression and algorithm evaluator
 All Classes Functions
org.quark.jasmine.Answer Class Reference

Public Member Functions

void setValue (Object value)
 
double toDouble_ () throws JasmineException
 
double toDouble ()
 
float toFloat_ () throws JasmineException
 
float toFloat ()
 
int toInteger_ () throws JasmineException
 
int toInteger ()
 
boolean toBoolean_ () throws JasmineException
 
boolean toBoolean ()
 

Public Attributes

Object value
 

Package Functions

 Answer ()
 
 Answer (Object value)
 

Detailed Description

This class is used to hold either

  • the answer to an expression, or
  • the value of a variable in an algorithm.


Jasmine uses the double data type throughout this class provides utilities methods to convert the answer to other data types.

Author
Peter Lager

Constructor & Destructor Documentation

org.quark.jasmine.Answer.Answer ( )
package

Create a null Answer object

org.quark.jasmine.Answer.Answer ( Object  value)
package

Create an Answer object with the given value.

Parameters
valueif null will be set

Member Function Documentation

void org.quark.jasmine.Answer.setValue ( Object  value)

Used by the generated QuarkExpression class object created in the default package.

boolean org.quark.jasmine.Answer.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.

Returns
Boolean interpretation of the base object.
boolean org.quark.jasmine.Answer.toBoolean_ ( ) throws JasmineException

Get the Boolean interpretation of the base object if a direct conversion can take place.

Returns
Boolean interpretation of the base object.
Exceptions
JasmineExceptionif the base object is not a Boolean or cannot be converted to a Boolean
double org.quark.jasmine.Answer.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.

Returns
Double interpretation of the base object.
double org.quark.jasmine.Answer.toDouble_ ( ) throws JasmineException

Get the Double interpretation of the base object if a direct conversion can take place.

Returns
Double interpretation of the base object.
Exceptions
JasmineExceptionif the base object is not a Double or cannot be converted to a Double
float org.quark.jasmine.Answer.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.

Returns
Float interpretation of the base object.
float org.quark.jasmine.Answer.toFloat_ ( ) throws JasmineException

Get the Float interpretation of the base object if a direct conversion can take place.

Returns
Float interpretation of the base object.
Exceptions
JasmineExceptionif the base object is not a Float or cannot be converted to a Float
int org.quark.jasmine.Answer.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.

Returns
Double interpretation of the base object.
int org.quark.jasmine.Answer.toInteger_ ( ) throws JasmineException

Get an Integer interpretation of the base object if a direct conversion can take place.

Returns
Integer interpretation of the base object.
Exceptions
JasmineExceptionif the base object is not an Integer or cannot be converted to an Integer

The documentation for this class was generated from the following file: