infix2postfix
Class NumericOperandManager

java.lang.Object
  extended byinfix2postfix.OperandManager
      extended byinfix2postfix.NumericOperandManager
Direct Known Subclasses:
DoubleOperandManager, FloatOperandManager, IntegerOperandManager, LongOperandManager

public abstract class NumericOperandManager
extends OperandManager

This class represents Numeric Operand Manager. Numeric operands like int,long,float, double etc can be managed by this manager. Numeric operands in a particular radix systems are also supported. Radix limits defined by java.lang.Character.MIN_RADIX and java.lang.Character.MAX_RADIX are supported. Default radix for numbers is assumed to be 10 (decimal system).

Author:
Maulin H. Vasavada

Field Summary
static int DEFAULT_RADIX
          Default radix for the numeric operands
protected  int radix
          Radix for the operands managed by this operand manager
 
Fields inherited from class infix2postfix.OperandManager
varHolder
 
Constructor Summary
NumericOperandManager()
          No-arg constructor.
NumericOperandManager(int radix)
          This constructor allows radix specified for the operands for this operand manager.
NumericOperandManager(VariableHolder varHolder)
          This constructor accepts custom "variable holder" as argument.
 
Method Summary
 int getRadix()
          Returns the radix being used by this operand manager.
 void setRadix(int radix)
          Sets radix for the operands managed by this operand manager.
 
Methods inherited from class infix2postfix.OperandManager
getDefaultVariableHolder, getVariableHolder, getVariableValue, isOperand, isVariable, setVariable, setVariableHolder
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_RADIX

public static final int DEFAULT_RADIX
Default radix for the numeric operands

See Also:
Constant Field Values

radix

protected int radix
Radix for the operands managed by this operand manager

Constructor Detail

NumericOperandManager

public NumericOperandManager()
No-arg constructor. This constructor uses DEFAULT_RADIX.


NumericOperandManager

public NumericOperandManager(int radix)
This constructor allows radix specified for the operands for this operand manager. This radix refers to the operands' radix system.

See Also:
setRadix(int)

NumericOperandManager

public NumericOperandManager(VariableHolder varHolder)
This constructor accepts custom "variable holder" as argument.

See Also:
VariableHolder
Method Detail

setRadix

public void setRadix(int radix)
Sets radix for the operands managed by this operand manager. The radix's range is defined by java.lang.Character.MIN_RADIX and java.lang.Character.MAX_RADIX. Radix out of this range is ignored and the existing value of the radix for this object prevails in that case.

See Also:
Character.MIN_RADIX, Character.MAX_RADIX

getRadix

public int getRadix()
Returns the radix being used by this operand manager.