|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjmathlib.core.interpreter.RootObject
jmathlib.core.tokens.Token
jmathlib.core.tokens.OperandToken
jmathlib.core.tokens.DataToken
jmathlib.core.tokens.VariableToken
public class VariableToken
Class representing any variables used in an expression
| Field Summary |
|---|
| Fields inherited from class jmathlib.core.tokens.DataToken |
|---|
dataType, noElem, sizeA, sizeX, sizeY |
| Fields inherited from class jmathlib.core.tokens.Token |
|---|
priority |
| Fields inherited from interface jmathlib.core.constants.ErrorCodes |
|---|
ERR_BRACKET_OPEN, ERR_BRACKET_ORDER, ERR_FUNCTION_NOT_FOUND, ERR_FUNCTION_NOT_IMPLEMENTED, ERR_INSUFFICIENT_PARAMETERS, ERR_INVALID_PARAMETER, ERR_LVALUE_REQUIRED, ERR_MATRIX_SINGULAR, ERR_NOT_SQUARE_MATRIX, ERR_OPNOTSUPPORTED, ERR_TOO_MANY_PARAMETERS, ERR_USER_ERROR, ERR_VARIABLE_NOTDEFINED, OK, OK_FUNCTION_PROCESS |
| Fields inherited from interface jmathlib.core.constants.TokenConstants |
|---|
ADDSUB_PRIORITY, AND_PRIORITY, ANDAND_PRIORITY, ASSIGN_PRIORITY, BRACKET_PRIORITY, COMPARE_PRIORITY, CONCAT, MATRIX, MULDIV_PRIORITY, OR_PRIORITY, OROR_PRIORITY, PARAMETER, POWER_PRIORITY, RELATION_PRIORITY, SINGLE, ttDelimiter, ttNotSet, ttOperand, ttOperator |
| Constructor Summary | |
|---|---|
VariableToken(java.lang.String _name)
constructor containing the variables name |
|
VariableToken(java.lang.String _name,
OperandToken[] _limits)
constructor containing the variables name and limiting arguments |
|
VariableToken(java.lang.String _name,
OperandToken[] _limits,
java.lang.String _type)
constructor containing the variables name and limiting arguments |
|
VariableToken(java.lang.String _name,
java.lang.String _fieldName)
constructor containing the variables name |
|
| Method Summary | |
|---|---|
boolean |
equals(java.lang.Object obj)
return the data of the variable |
boolean |
equals(OperandToken _data)
Implement the equals operator to find a VariableToken with the correct name |
OperandToken |
evaluate(Token[] operands,
GlobalValues globals)
evaluate the token |
java.lang.String |
getFieldName()
return the name of the variable |
OperandToken[] |
getLimits()
return limits of this variable |
java.lang.String |
getName()
return the name of the variable |
Variable |
getVariable(GlobalValues globals)
get the variable that this token references |
boolean |
isCell()
check if variable is a cell array |
boolean |
isLimited()
|
boolean |
isStruct()
check if variable is a struct |
void |
setLimits(OperandToken[] _limits)
set limits for variable (e.g. a(1,3:4) ) |
java.lang.String |
toString()
|
| Methods inherited from class jmathlib.core.tokens.DataToken |
|---|
checkEqualDimensions, getDataType, getDimensions, getElement, getElement, getElementSized, getNumberOfElements, getSize, getSizeX, getSizeY, setElement, setElement, setSize |
| Methods inherited from class jmathlib.core.tokens.OperandToken |
|---|
add, asArray, Children, ctranspose, derivative, divide, expand, factorial, integral, isLeaf, isNull, isNumeric, leftDivide, mpower, mPower, multiply, negate, power, scalarDivide, scalarLeftDivide, scalarMultiply, simplify, subst, subtract, transpose |
| Methods inherited from class jmathlib.core.tokens.Token |
|---|
isDisplayResult, setDisplayResult, toMathMlString, toString |
| Methods inherited from class jmathlib.core.interpreter.RootObject |
|---|
clone, toString |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public VariableToken(java.lang.String _name)
_name - = the name of the variable
public VariableToken(java.lang.String _name,
java.lang.String _fieldName)
_name - = the name of the variable_var - = the variable being referenced
public VariableToken(java.lang.String _name,
OperandToken[] _limits)
_name - = the name of the variable_operands - = the limits of this variable (e.g. a(1,2:4) )
public VariableToken(java.lang.String _name,
OperandToken[] _limits,
java.lang.String _type)
_name - = the name of the variable_operands - = the limits of this variable (e.g. a(1,2:4) )_type - = 'cell' if cell variable| Method Detail |
|---|
public boolean isLimited()
public void setLimits(OperandToken[] _limits)
limits - = the limiting operands (DoubleNumberToken, ColonOperator)public OperandToken[] getLimits()
public OperandToken evaluate(Token[] operands,
GlobalValues globals)
Token
evaluate in class Tokenoperands - = an array of RootObject containing the tokens operands
public boolean equals(OperandToken _data)
_data - = the object to match against
public java.lang.String toString()
toString in class Tokenpublic java.lang.String getName()
public java.lang.String getFieldName()
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic boolean isStruct()
public boolean isCell()
public Variable getVariable(GlobalValues globals)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||