jsynoptic.parser
Class Variable

java.lang.Object
  extended by jsynoptic.parser.Variable
All Implemented Interfaces:
VariableDefinition

public class Variable
extends java.lang.Object
implements VariableDefinition

A ready to use Variable class, implementing VariableDefinition


Constructor Summary
Variable(java.lang.String name)
          Creates a variable of the specified name with the default value of 0
Variable(java.lang.String name, byte value)
          Creates a variable of the specified name with the given value
Variable(java.lang.String name, double value)
          Creates a variable of the specified name with the given value
Variable(java.lang.String name, float value)
          Creates a variable of the specified name with the given value
Variable(java.lang.String name, int value)
          Creates a variable of the specified name with the given value
Variable(java.lang.String name, long value)
          Creates a variable of the specified name with the given value
Variable(java.lang.String name, java.lang.Number value)
          Creates a variable of the specified name with the given value
Variable(java.lang.String name, short value)
          Creates a variable of the specified name with the given value
 
Method Summary
 java.lang.String getName()
           
 java.lang.Number getValue()
           
 void setValue(byte n)
          Sets the new value for this variable to the byte n
 void setValue(double n)
          Sets the new value for this variable to the double n
 void setValue(float n)
          Sets the new value for this variable to the float n
 void setValue(int n)
          Sets the new value for this variable to the int n
 void setValue(long n)
          Sets the new value for this variable to the long n
 void setValue(java.lang.Number n)
          Sets the new value for this variable to the Number n
 void setValue(short n)
          Sets the new value for this variable to the short n
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Variable

public Variable(java.lang.String name,
                java.lang.Number value)
Creates a variable of the specified name with the given value

Parameters:
name -
value -

Variable

public Variable(java.lang.String name)
Creates a variable of the specified name with the default value of 0

Parameters:
name -

Variable

public Variable(java.lang.String name,
                byte value)
Creates a variable of the specified name with the given value

Parameters:
name -
value -

Variable

public Variable(java.lang.String name,
                short value)
Creates a variable of the specified name with the given value

Parameters:
name -
value -

Variable

public Variable(java.lang.String name,
                int value)
Creates a variable of the specified name with the given value

Parameters:
name -
value -

Variable

public Variable(java.lang.String name,
                long value)
Creates a variable of the specified name with the given value

Parameters:
name -
value -

Variable

public Variable(java.lang.String name,
                float value)
Creates a variable of the specified name with the given value

Parameters:
name -
value -

Variable

public Variable(java.lang.String name,
                double value)
Creates a variable of the specified name with the given value

Parameters:
name -
value -
Method Detail

getName

public java.lang.String getName()
Specified by:
getName in interface VariableDefinition
Returns:
this variable name. Used at parse time

getValue

public java.lang.Number getValue()
Specified by:
getValue in interface VariableDefinition
Returns:
this variable value. Used at evaluation time

setValue

public void setValue(java.lang.Number n)
Sets the new value for this variable to the Number n


setValue

public void setValue(byte n)
Sets the new value for this variable to the byte n


setValue

public void setValue(short n)
Sets the new value for this variable to the short n


setValue

public void setValue(int n)
Sets the new value for this variable to the int n


setValue

public void setValue(long n)
Sets the new value for this variable to the long n


setValue

public void setValue(float n)
Sets the new value for this variable to the float n


setValue

public void setValue(double n)
Sets the new value for this variable to the double n