infix2postfix
Interface VariableHolder


public interface VariableHolder

This interface models container for variables in the expression. It behaves similar to "symbol table" concept in compilers.

Author:
Maulin H. Vasavada

Method Summary
 java.lang.Object getVariableValue(java.lang.Object variable)
          Returns the value associated with the variable.
 boolean isVariable(java.lang.Object symbol)
          Verifies if the given symbol is variable or not.
 void setVariable(java.lang.Object variable, java.lang.Object value)
          Sets the value of the specified variable.
 

Method Detail

isVariable

public boolean isVariable(java.lang.Object symbol)
Verifies if the given symbol is variable or not.

Returns:
boolean true if variable exist in the list of registered variables;false otherwise

setVariable

public void setVariable(java.lang.Object variable,
                        java.lang.Object value)
Sets the value of the specified variable. If the variable doesn't exist then it adds to the variable to the list of varibles.


getVariableValue

public java.lang.Object getVariableValue(java.lang.Object variable)
Returns the value associated with the variable.