goldengine.java
Class VariableList

java.lang.Object
  |
  +--goldengine.java.VariableList

public class VariableList
extends java.lang.Object

-------------------------------------------------------------------------------------------
Source File: VariableList.java
Author: Devin Cook, Matthew Hawkins
Description: A holding class for VariableTypes, with special methods needed that a Vector can not fulfil.
-------------------------------------------------------------------------------------------
Revision List

      Author          Version         Description
      ------          -------         -----------
      MPH             1.0             First Issue

-------------------------------------------------------------------------------------------
IMPORT: java.util
-------------------------------------------------------------------------------------------


Constructor Summary
VariableList()
           
 
Method Summary
 boolean add(java.lang.String name, java.lang.String value, java.lang.String comment)
          add This method will add a new variable to the list.
 void clearValues()
          clearValues This method will set the name of each variable to "".
 int count()
          count This method returns the current number of variables.
 java.lang.String getValue(java.lang.String name)
          getValue This method will return the value of the variable with the same name as that specified.
 java.lang.String name(int index)
          name Return the name of the Variable at the specified index.
 void setValue(java.lang.String name, java.lang.String value)
          setValue This method sets the value of a variable of the same name as that specified.
 int variableIndex(java.lang.String name)
          variableIndex This method will return the index number of a variable that has the same name as that specified.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VariableList

public VariableList()
Method Detail

add

public boolean add(java.lang.String name,
                   java.lang.String value,
                   java.lang.String comment)
add This method will add a new variable to the list. It will do this if and only if there is not an equivalent variable already in the list. If there is not, it will create a new VariableType.
Parameters:
name - The name of the variable.
value - The value of the variable.
comment - Any associated comment for the variable.
Returns:
Will return true if the variable was not found, false if it was.

clearValues

public void clearValues()
clearValues This method will set the name of each variable to "".

count

public int count()
count This method returns the current number of variables.
Returns:
The number of variables in the list.

name

public java.lang.String name(int index)
name Return the name of the Variable at the specified index. It will do this if and only if the index is not less than 0, and if the index is less than the current number of variables.
Parameters:
index - The index of the variable to check.
Returns:
The name of the variable at the specified index.

setValue

public void setValue(java.lang.String name,
                     java.lang.String value)
setValue This method sets the value of a variable of the same name as that specified.
Parameters:
name - The name of the variable to set its value.
value - The new value to set.

getValue

public java.lang.String getValue(java.lang.String name)
getValue This method will return the value of the variable with the same name as that specified.
Parameters:
name - The name of the variable wanted.
Returns:
The value of the variable specified.

variableIndex

public int variableIndex(java.lang.String name)
variableIndex This method will return the index number of a variable that has the same name as that specified.
Parameters:
name - The name of the variable to get its index.
Returns:
The index in the list of the variable.