|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.scheinerman.phoenix.interpreter.variables.AbstractVariable
net.scheinerman.phoenix.interpreter.variables.FunctionVariable
public class FunctionVariable
Field Summary | |
---|---|
private Function |
function
|
Fields inherited from class net.scheinerman.phoenix.interpreter.variables.AbstractVariable |
---|
constant, functionReference, literal |
Constructor Summary | |
---|---|
FunctionVariable(Function function)
|
Method Summary | |
---|---|
Variable |
add(Variable v)
Takes two variables and returns the addition operator solution. |
Variable |
and(Variable v)
Takes two variables and returns the logical and operator solution. |
void |
assign(Variable v)
Assigns a new variable value to this variable. |
Variable |
copy()
Returns a copy of this variable. |
Variable |
divide(Variable v)
Takes two variables and returns the division operator solution. |
Variable |
exp(Variable v)
Takes two variables and returns the exponentiation operator solution. |
Function |
getFunction()
|
Variable |
greaterEqual(Variable v)
Takes two variables and returns the greater than or equal to operator solution. |
Variable |
greaterThan(Variable v)
Takes two variables and returns the greater than operator solution. |
Variable |
isEqualTo(Variable v)
Takes two variables and returns the equality operator solution. |
Variable |
lessEqual(Variable v)
Takes two variables and returns the less than or equal to operator solution. |
Variable |
lessThan(Variable v)
Takes two variables and returns the less than operator solution. |
Variable |
mod(Variable v)
Takes two variables and returns the modulus arithmetic operator solution. |
Variable |
multiply(Variable v)
Takes two variables and returns the multiplication operator solution. |
Variable |
not()
Returns the result of the logical not (complement) of this variable. |
Variable |
notEqualTo(Variable v)
Takes two variables and returns the inequality operator solution. |
Variable |
or(Variable v)
Takes two variables and returns the logical inclusive or operator solution. |
Variable |
round(Variable v)
Takes two variables and returns the rouding operator solution. |
Variable |
subscript(Variable sub)
Returns the result of a simple, one variable subscript of this variable. |
Variable |
subscript(Variable sub1,
Variable sub2)
Returns the result of a two variable subscript of this variable. |
Variable |
subtract(Variable v)
Takes two variables and returns the subtraction operator solution. |
java.lang.String |
toString()
|
Variable |
xor(Variable v)
Takes two variables and returns the logical exclusive operator solution. |
Methods inherited from class net.scheinerman.phoenix.interpreter.variables.AbstractVariable |
---|
equals, getType, isConstant, isFunctionReference, isLiteral, setConstant, setFunctionReference, setLiteral |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private Function function
Constructor Detail |
---|
public FunctionVariable(Function function)
Method Detail |
---|
public Function getFunction()
public void assign(Variable v)
Variable
SyntaxException
if it is not. This method must be
supported, it should not throw a UnsupportedOperatorException
.
v
- - the variable to assign this variable to bepublic Variable add(Variable v)
Variable
x.add(y)
is equivalent to
x + y
. This operator is not required and can therefore throw the
UnsupportedOperatorException
. If the variable passed to this operator is of a wrong type
a SyntaxException
should be thrown.
v
- - the variable to operate on
public Variable subtract(Variable v)
Variable
x.subtract(y)
is equivalent to
x - y
. This operator is not required and can therefore throw the
UnsupportedOperatorException
. If the variable passed to this operator is of a wrong type
a SyntaxException
should be thrown.
v
- - the variable to operate on
public Variable multiply(Variable v)
Variable
x.multiply(y)
is equivalent to
x * y
. This operator is not required and can therefore throw the
UnsupportedOperatorException
. If the variable passed to this operator is of a wrong type
a SyntaxException
should be thrown.
v
- - the variable to operate on
public Variable divide(Variable v)
Variable
x.divide(y)
is equivalent to
x / y
. This operator is not required and can therefore throw the
UnsupportedOperatorException
. If the variable passed to this operator is of a wrong type
a SyntaxException
should be thrown.
v
- - the variable to operate on
public Variable mod(Variable v)
Variable
x.mod(y)
is equivalent to
x % y
. This operator is not required and can therefore throw the
UnsupportedOperatorException
. If the variable passed to this operator is of a wrong type
a SyntaxException
should be thrown.
v
- - the variable to operate on
public Variable exp(Variable v)
Variable
x.exp(y)
is equivalent to
x ^ y
. This operator is not required and can therefore throw the
UnsupportedOperatorException
. If the variable passed to this operator is of a wrong type
a SyntaxException
should be thrown.
v
- - the variable to operate on
public Variable round(Variable v)
Variable
x.round(y)
is equivalent to
x # y
. This operator is not required and can therefore throw the
UnsupportedOperatorException
. If the variable passed to this operator is of a wrong type
a SyntaxException
should be thrown.
v
- - the variable to operate on
public Variable isEqualTo(Variable v)
Variable
x.isEqualTo(y)
is equivalent to
x == y
. This operator is not required and can therefore throw the
UnsupportedOperatorException
. If the variable passed to this operator is of a wrong type
a SyntaxException
should be thrown.
v
- - the variable to operate on
public Variable notEqualTo(Variable v)
Variable
x.notEqualTo(y)
is equivalent to
x != y
. This operator is not required and can therefore throw the
UnsupportedOperatorException
. If the variable passed to this operator is of a wrong type
a SyntaxException
should be thrown.
v
- - the variable to operate on
public Variable greaterThan(Variable v)
Variable
x.greaterThan(y)
is equivalent to
x > y
. This operator is not required and can therefore throw the
UnsupportedOperatorException
. If the variable passed to this operator is of a wrong type
a SyntaxException
should be thrown.
v
- - the variable to operate on
public Variable lessThan(Variable v)
Variable
x.lessThan(y)
is equivalent to
x < y
. This operator is not required and can therefore throw the
UnsupportedOperatorException
. If the variable passed to this operator is of a wrong type
a SyntaxException
should be thrown.
v
- - the variable to operate on
public Variable greaterEqual(Variable v)
Variable
x.greaterEqual(y)
is equivalent to
x == y
. This operator is not required and can therefore throw the
UnsupportedOperatorException
. If the variable passed to this operator is of a wrong type
a SyntaxException
should be thrown.
v
- - the variable to operate on
public Variable lessEqual(Variable v)
Variable
x.lessEqual(y)
is equivalent to
x <= y
. This operator is not required and can therefore throw the
UnsupportedOperatorException
. If the variable passed to this operator is of a wrong type
a SyntaxException
should be thrown.
v
- - the variable to operate on
public Variable and(Variable v)
Variable
x.and(y)
is equivalent to
x & y
. This operator is not required and can therefore throw the
UnsupportedOperatorException
. If the variable passed to this operator is of a wrong type
a SyntaxException
should be thrown.
v
- - the variable to operate on
public Variable or(Variable v)
Variable
x.or(y)
is equivalent to
x | y
. This operator is not required and can therefore throw the
UnsupportedOperatorException
. If the variable passed to this operator is of a wrong type
a SyntaxException
should be thrown.
v
- - the variable to operate on
public Variable xor(Variable v)
Variable
x.xor(y)
is equivalent to
x (+) y
. This operator is not required and can therefore throw the
UnsupportedOperatorException
. If the variable passed to this operator is of a wrong type
a SyntaxException
should be thrown.
v
- - the variable to operate on
public Variable not()
Variable
x.not()
is equivalent to
!x
. This operator is not required and can therefore throw the
UnsupportedOperatorException
.
public Variable subscript(Variable sub)
Variable
x.subscript(y)
is equivalent to
x[y]
. This operator is not required and can therefore throw the
UnsupportedOperatorException
.
sub
- - the variable to operate on
public Variable subscript(Variable sub1, Variable sub2)
Variable
x.subscript(y,z)
is equivalent to
x[y:z]
. This operator is not required and can therefore throw the
UnsupportedOperatorException
.
sub1
- - the first subscript variablesub2
- - the second subscript variable
public Variable copy()
Variable
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |