|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object fr.expression4j.basic.impl.ParametersDefExpressionElement
public class ParametersDefExpressionElement
Parse a parameter def. Parameter def is parameter definition in function definition. por expression "f(x)=2*x", parameter def is "x" in "f(x)". BNF is parameters-def ::= variable "," parameters-def | variable | "" varaible ::= letters integer | letters letters ::= letter letters | letter letter ::= [a-Z]
Constructor Summary | |
---|---|
ParametersDefExpressionElement()
|
Method Summary | |
---|---|
MathematicalElement |
evaluate(TreeElement element,
Catalog catalog,
OperatorManager operatorManager,
Parameters parameters,
ExpressionModel model)
Evaluate the value of the current expression element |
java.lang.String |
getName()
get the name of the element (like integer, variable ...) |
protected boolean |
operator(java.lang.String expression,
java.lang.String operatorList,
int position)
check if char at position in expression is in given operator list. |
boolean |
parseElement(java.lang.String expression,
ExpressionModel expressionModel,
ParseInfo parseInfo,
Catalog catalog,
java.util.List functionParameters,
int priorityOperatorLevel)
Parse an element of an expression like term, real, integer ... |
java.lang.String |
toString(TreeElement element,
ExpressionModel expressionModel)
Create the String object associated to the expression element. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ParametersDefExpressionElement()
Method Detail |
---|
protected boolean operator(java.lang.String expression, java.lang.String operatorList, int position)
operatorList
- operator list as string.position
- position to check.
true
if operator at position is in the given operator list.public boolean parseElement(java.lang.String expression, ExpressionModel expressionModel, ParseInfo parseInfo, Catalog catalog, java.util.List functionParameters, int priorityOperatorLevel) throws ParsingException
ExpressionElement
parseElement
in interface ExpressionElement
expression
- expression to parse.expressionModel
- meta model of expression.parseInfo
- info about parsingcatalog
- function and constant catalogfunctionParameters
- parameters of the function (f(x), x is a parameter)priorityOperatorLevel
- priority of current operator.
true
if the expression content the element at the given position.
ParsingException
public java.lang.String getName()
ExpressionElement
getName
in interface ExpressionElement
public MathematicalElement evaluate(TreeElement element, Catalog catalog, OperatorManager operatorManager, Parameters parameters, ExpressionModel model) throws EvalException
ExpressionElement
evaluate
in interface ExpressionElement
element
- tree element of the expression.operatorManager
- operator manager of the current expression.parameters
- parameters given to the expression.
EvalException
public java.lang.String toString(TreeElement element, ExpressionModel expressionModel)
ExpressionElement
toString
in interface ExpressionElement
element
- element properties for convertion.expressionModel
- expression model to use for current expression element.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |