infix2postfix
Class BooleanOperandManager

java.lang.Object
  extended byinfix2postfix.OperandManager
      extended byinfix2postfix.BooleanOperandManager

public class BooleanOperandManager
extends OperandManager

This class represents boolean operand manager. It follows "boolean" data types for operand values as "validity criteria".

Author:
Maulin H. Vasavada

Field Summary
 
Fields inherited from class infix2postfix.OperandManager
varHolder
 
Constructor Summary
BooleanOperandManager()
          No-arg constructor.
BooleanOperandManager(VariableHolder varHolder)
          Constructor accepting custom "variable holder" as argument.
 
Method Summary
 boolean getBooleanOperand(java.lang.Object operand)
          Returns operand in boolean format.
 boolean isOperand(java.lang.Object symbol)
          Defines the validity criteria for operands accepted by this operand manager.
 
Methods inherited from class infix2postfix.OperandManager
getDefaultVariableHolder, getVariableHolder, getVariableValue, isVariable, setVariable, setVariableHolder
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BooleanOperandManager

public BooleanOperandManager()
No-arg constructor.


BooleanOperandManager

public BooleanOperandManager(VariableHolder varHolder)
Constructor accepting custom "variable holder" as argument.

Method Detail

isOperand

public boolean isOperand(java.lang.Object symbol)
Defines the validity criteria for operands accepted by this operand manager. A "valid variable" is also considered to be an operand.
"Validity criteria" for this operand manager is-
All symbols of type boolean and all variables having boolean value are valid operands.

Specified by:
isOperand in class OperandManager
Returns:
boolean true if the given symbol is of "boolean" type;false otherwise

getBooleanOperand

public boolean getBooleanOperand(java.lang.Object operand)
                          throws InvalidOperandException
Returns operand in boolean format.

Throws:
InvalidOperandException - If the given operand doesn't satisfy "validity criteria" defined for this manager.
See Also:
isOperand(Object)