public class Variable extends ArithmeticBase implements java.lang.Comparable<Variable>
VariableFactory
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
myName |
gelementsToValue
Constructor and Description |
---|
Variable(java.lang.String name)
Represents a variable
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Variable v)
Compare the variables by their names.
|
boolean |
equals(java.lang.Object o)
Determines equality based on the Variable's name
|
java.lang.Double |
evaluate(Context c)
uses the hook/template method value to return a Double
|
java.lang.String |
toString() |
java.lang.String |
toStringV() |
double |
value(Context c) |
public Variable(java.lang.String name)
name
- - the variable's name, e.g., "X"public double value(Context c)
value
in class ArithmeticBase
public java.lang.Double evaluate(Context c)
evaluate
in class ArithmeticBase
c
- the context of the expression--may affect the valuepublic boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int compareTo(Variable v)
compareTo
in interface java.lang.Comparable<Variable>
public java.lang.String toStringV()
public java.lang.String toString()
toString
in class java.lang.Object