Class Num
java.lang.Object
Expr
Value
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
|
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. |
Num
Num(double _x)
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.