com.satline.expr
Class NumberConstant

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

public abstract class NumberConstant
extends java.lang.Object
implements Constant

Base class for all numeric constant expressions.

Author:
Teubner
See Also:
Serialized Form

Field Summary
protected  java.lang.Number value
           
 
Constructor Summary
protected NumberConstant()
          Default constructor
protected NumberConstant(java.lang.Number value)
          Constructor using value
 
Method Summary
 boolean equals(java.lang.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(java.lang.Number value)
          Set constant value.
 java.lang.String toString()
          Get string representation.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

value

protected java.lang.Number value
Constructor Detail

NumberConstant

protected NumberConstant()
Default constructor


NumberConstant

protected NumberConstant(java.lang.Number value)
Constructor using value

Parameters:
value - - constant value
Method Detail

setValue

public void setValue(java.lang.Number value)
Set constant value.

Parameters:
value - - constant value.

greet

public <E,F> E greet(ExpressionWalker<E,F> visitor,
                     F arg)
        throws ExpressionException
Handle visit of ExpressionWalker.

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

toString

public java.lang.String toString()
Get string representation.

Overrides:
toString in class java.lang.Object
Returns:
string representation

equals

public boolean equals(java.lang.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 Field object with equal value as this object.

Overrides:
equals in class java.lang.Object
Parameters:
obj - - object to compare with
Returns:
true if the objects are the same, false otherwise

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object


Copyright © 2007 null. All Rights Reserved.