|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.scheinerman.phoenix.interpreter.variables.AbstractVariable
public abstract class AbstractVariable
Manages several of the methods of the Variable
interface so that they don't need to
be implemented by the StringVariable
and NumberVariable
classes. These
methods are the simple getter and setter methods for the literal and constant flags.
Field Summary | |
---|---|
(package private) boolean |
constant
Indicates whether or not this is a constant (immutable) variable. |
(package private) boolean |
functionReference
|
(package private) boolean |
literal
Indicates whether or not this is a literal variable (not assigned to an identifier). |
Constructor Summary | |
---|---|
AbstractVariable()
|
Method Summary | |
---|---|
boolean |
equals(Variable v)
Tests to see if the type of the two variables are equal by checking the equality of the strings returned by the getType() method. |
java.lang.String |
getType()
Returns a string name of this particular variable type. |
boolean |
isConstant()
Returns whether or not this variable is a constant variable. |
boolean |
isFunctionReference()
|
boolean |
isLiteral()
Returns whether or not this variable is a literal variable. |
void |
setConstant(boolean constant)
Defines whether or not this variable is a constant variable. |
void |
setFunctionReference(boolean functionReference)
|
void |
setLiteral(boolean literal)
Defines whether or not this variable is a literal variable. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface net.scheinerman.phoenix.interpreter.variables.Variable |
---|
add, and, assign, copy, divide, exp, greaterEqual, greaterThan, isEqualTo, lessEqual, lessThan, mod, multiply, not, notEqualTo, or, round, subscript, subscript, subtract, xor |
Field Detail |
---|
boolean literal
boolean constant
boolean functionReference
Constructor Detail |
---|
public AbstractVariable()
Method Detail |
---|
public java.lang.String getType()
Variable
"int"
. This method should not vary based on the contents
of the variable.
getType
in interface Variable
"void"
public boolean equals(Variable v)
getType()
method.
v
- - The other variable
true
if the types match, false
otherwise.public void setConstant(boolean constant)
Variable
true
, then the variable cannot
be assigned, and if false
, then the variable can be assigned. If true
, than the
assign(Variable)
method will throw a SyntaxException
setConstant
in interface Variable
constant
- - whether or not this is a constant variable.public void setLiteral(boolean literal)
Variable
true
, then the variable cannot be
assigned. If false
, then the variable is a defined variable and can be assigned. If this is set
to true
, than the assign(Variable)
method will throw a SyntaxException
.
setLiteral
in interface Variable
literal
- - whether or not this is a literal value.public void setFunctionReference(boolean functionReference)
setFunctionReference
in interface Variable
public boolean isConstant()
Variable
isConstant
in interface Variable
public boolean isLiteral()
Variable
isLiteral
in interface Variable
public boolean isFunctionReference()
isFunctionReference
in interface Variable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |