org.hccp.lisp
Class NumericAtom

java.lang.Object
  |
  +--org.hccp.lisp.Atom
        |
        +--org.hccp.lisp.NumericAtom
All Implemented Interfaces:
Sexp

public class NumericAtom
extends Atom

Wrapper class for numeric atoms.

See Also:
BooleanAtom

Constructor Summary
NumericAtom(java.lang.Double value)
           
NumericAtom(java.lang.Object value)
           
 
Method Summary
 double doubleValue()
           
 boolean equals(java.lang.Object obj)
          Indicates whether some other object is "equal to" this one.
 org.hccp.lisp.Sexp evaluate()
           
 org.hccp.lisp.NumericAtom getFlippedSignAtom()
           
 java.lang.Object getValue()
           
 
Methods inherited from class org.hccp.lisp.Atom
hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NumericAtom

public NumericAtom(java.lang.Object value)

NumericAtom

public NumericAtom(java.lang.Double value)
Method Detail

getValue

public java.lang.Object getValue()
Overrides:
getValue in class Atom

doubleValue

public double doubleValue()

getFlippedSignAtom

public org.hccp.lisp.NumericAtom getFlippedSignAtom()

evaluate

public org.hccp.lisp.Sexp evaluate()
Specified by:
evaluate in interface Sexp
Overrides:
evaluate in class Atom

equals

public boolean equals(java.lang.Object obj)
Description copied from class: Atom
Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

The equals method for class Object implements the most discriminating possible equivalence relation on objects; that is, for any non-null reference values x and y, this method returns true if and only if x and y refer to the same object (x == y has the value true).

Note that it is generally necessary to override the hashCode method whenever this method is overridden, so as to maintain the general contract for the hashCode method, which states that equal objects must have equal hash codes.

Overrides:
equals in class Atom
Parameters:
obj - the reference object with which to compare.
Returns:
true if this object is the same as the obj argument; false otherwise.
See Also:
Atom.hashCode(), Hashtable