common-util

local.tomas.expr
Class NumberConstant

java.lang.Object
  extended by local.tomas.expr.NumberConstant
All Implemented Interfaces:
Serializable, Constant, Expression
Direct Known Subclasses:
DoubleConstant, IntegerConstant

public abstract class NumberConstant
extends Object
implements Constant

Base class for all numeric constant expressions.

Author:
Teubner
See Also:
Serialized Form

Field Summary
protected  Number value
          Numeric value.
 
Constructor Summary
protected NumberConstant()
          Default constructor
protected NumberConstant(Number value)
          Constructor using value
 
Method Summary
 boolean equals(Object obj)
          Compares this object against the specified object.
<E,F> E
greet(ExpressionWalker<E,F> visitor, F arg)
          Handle visit of ExpressionWalker.
 int hashCode()
           
 void setValue(Number value)
          Set constant value.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

value

protected Number value
Numeric value.

Constructor Detail

NumberConstant

protected NumberConstant()
Default constructor


NumberConstant

protected NumberConstant(Number value)
Constructor using value

Parameters:
value - constant value
Method Detail

setValue

public void setValue(Number value)
Set constant value.

Parameters:
value - constant value.

greet

public <E,F> E greet(ExpressionWalker<E,F> visitor,
                     F arg)
        throws ExpressionException
Description copied from interface: Expression
Handle visit of ExpressionWalker.

Specified by:
greet in interface Expression
Parameters:
visitor - the ExpressionWalker visiting this object
arg - implementation dependent argument
Returns:
implementation dependent result
Throws:
ExpressionException

toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object obj)
Compares this object against the specified object. The result is true if and only if the argument is not null and is a NumberConstant object with equal value as this object.

Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

common-util

Copyright © 2005-2007 Tomas Teubner. All Rights Reserved.