Venice 0.7beta

org.mov.parser
Class Variables

java.lang.Object
  extended by org.mov.parser.Variables

public class Variables
extends java.lang.Object

A collection of variables.


Constructor Summary
Variables()
          Create a new empty collection of variables.
 
Method Summary
 void add(java.lang.String name, int type, boolean isConstant)
          Add a new variable.
 void add(java.lang.String name, int type, boolean isConstant, double value)
          Add a new variable.
 void add(java.lang.String name, int type, boolean isConstant, int value)
          Add a new variable.
 java.lang.Object clone()
          Creates a deep clone of variables.
 boolean contains(java.lang.String name)
          Return whether the collection contains the given variable.
 Variable get(java.lang.String name)
          Get the variable of the given name.
 int getType(java.lang.String name)
          Get the type of the variable.
 double getValue(java.lang.String name)
          Get the value of the variable.
 void setValue(java.lang.String name, double value)
          Set the value of the given variable.
 void setValue(java.lang.String name, int value)
          Set the value of the given variable.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Variables

public Variables()
Create a new empty collection of variables.

Method Detail

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Creates a deep clone of variables.

Overrides:
clone in class java.lang.Object
Returns:
a clone.
Throws:
java.lang.CloneNotSupportedException - this should never happen.

contains

public boolean contains(java.lang.String name)
Return whether the collection contains the given variable.

Parameters:
name - the name of the variable o query.

add

public void add(java.lang.String name,
                int type,
                boolean isConstant)
Add a new variable. The variable will be initialised to zero if numeric or FALSE if boolean.

Parameters:
name - the name of the variable.
type - the type of the variable.
isConstant - set to TRUE if the variable is a constant.

add

public void add(java.lang.String name,
                int type,
                boolean isConstant,
                double value)
Add a new variable.

Parameters:
name - the name of the variable.
type - the type of the variable.
isConstant - set to TRUE if the variable is a constant.
value - the initial value.

add

public void add(java.lang.String name,
                int type,
                boolean isConstant,
                int value)
Add a new variable.

Parameters:
name - the name of the variable.
type - the type of the variable.
isConstant - set to TRUE if the variable is a constant.
value - the initial value.

setValue

public void setValue(java.lang.String name,
                     double value)
Set the value of the given variable.

Parameters:
name - the name of the variable.
value - the new value of the variable.

setValue

public void setValue(java.lang.String name,
                     int value)
Set the value of the given variable.

Parameters:
name - the name of the variable.
value - the new value of the variable.

getValue

public double getValue(java.lang.String name)
Get the value of the variable.

Parameters:
name - the name of the variable.
Returns:
the variable's value.

getType

public int getType(java.lang.String name)
Get the type of the variable.

Parameters:
name - the name of the variable.
Returns:
the variable's type.

get

public Variable get(java.lang.String name)
Get the variable of the given name.

Parameters:
name - the name of the variable.
Returns:
the variable.

Venice 0.7beta