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