|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjcaas.script_nodes.NumericValue
public class NumericValue
This class represents a NUMERIC_VALUE in a script.
Field Summary | |
---|---|
static int |
DOUBLE
|
static int |
INTEGER
|
Constructor Summary | |
---|---|
NumericValue(double value)
Construct a NumericValue given a double. |
|
NumericValue(java.lang.Double doubleValue)
Constructs a NumericValue given a Double. |
|
NumericValue(int value)
Construct a NumericValue given an int. |
|
NumericValue(java.lang.Integer intValue)
Constructs a NumericValue given an Integer. |
Method Summary | |
---|---|
static NumericValue |
add(NumericValue a,
NumericValue b)
Adds two NumericValues and returns the value as a NumericValue. |
int |
compareTo(java.lang.Object o)
|
static NumericValue |
divide(NumericValue a,
NumericValue b)
Divides two NumericValues and returns the value as a NumericValue. |
boolean |
equals(java.lang.Object o)
Determines if two NumericValues are equal which occurs if they have the exact same value, but do not need to have the same type. |
java.lang.Double |
getDouble()
Gives the double representation of this NumericValue. |
java.lang.Integer |
getInteger()
Gives the integer representation of this NumericValue. |
int |
getType()
Gives the type of this NumericValue. |
java.lang.Number |
getValue()
Returns the value of this NumericValue as a Number instance. |
static NumericValue |
multiply(NumericValue a,
NumericValue b)
Multiplies tow NumericValues and returns the value as a NumericValue. |
static NumericValue |
subtract(NumericValue a,
NumericValue b)
Subtracts two NumericValues and returns the value as a NumericValue. |
java.lang.String |
toString()
Gives the value as a string. |
Methods inherited from class java.lang.Object |
---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int DOUBLE
public static final int INTEGER
Constructor Detail |
---|
public NumericValue(java.lang.Integer intValue)
intValue
- the value of this NumericValue.public NumericValue(java.lang.Double doubleValue)
doubleValue
- the value of this NumericValue.public NumericValue(double value)
value
- the value of this NumericValue.public NumericValue(int value)
value
- the value of this NumericValue.Method Detail |
---|
public int getType()
public java.lang.Integer getInteger()
public java.lang.Double getDouble()
public java.lang.Number getValue()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public static NumericValue add(NumericValue a, NumericValue b)
a
- NumericValue to be added to.b
- NumericValue to add.
public static NumericValue subtract(NumericValue a, NumericValue b)
a
- NumericValue to subtract from.b
- NumericValue to subtract.
public static NumericValue divide(NumericValue a, NumericValue b)
a
- NumericValue to divide.b
- NumericValue to divide by.
public static NumericValue multiply(NumericValue a, NumericValue b)
a
- NumericValue to multiply.b
- NumericValue to multiply by.
public int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |