Class Num

java.lang.Object
  extended by Expr
      extended by Value
          extended by Num

public class Num
extends Value

Our internal representation of a number in the Q0 language. See http://www.radford.edu/itec380/2009fall-ibarland/Hw06/hw06.html

Version:
2014.Nov.04
Author:
Ian Barland

Field Summary
 
Fields inherited from class Expr
PUNCTUATION
 
Constructor Summary
Num(double _x)
           
 
Method Summary
(package private)  double doubleValue()
          Return the Java double this Value represents (for use by other primitives in our language.)
 boolean equals(Object that)
           
 int hashCode()
           
 String toString()
          Return a String representation of this Expr.
 
Methods inherited from class Value
eval
 
Methods inherited from class Expr
parse, parse
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Num

Num(double _x)
Method Detail

doubleValue

double doubleValue()
Return the Java double this Value represents (for use by other primitives in our language.)

Returns:
the Java double this Value represents.

equals

public boolean equals(Object that)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Value

toString

public String toString()
Description copied from class: Expr
Return a String representation of this Expr. The result will be something which can be passed into 'parse(String)' to get the same Expr back. That is, toString and parse are inverses of each other.

Specified by:
toString in class Expr
Returns:
a String representation of this Expr.