public class FunctionCall extends UnaryOperation
FunctionCall
is a UnaryOperation
which
represents a mathematical function call (e.g.: f(2)). The example shows,
that an Expression, which looks like an implicit times operation, might be a
FunctionCall
instead, if "f" is defined as a Function
by the user.
FunctionCall
is the Expression
representing the parameter values, e.g. f(2,3,4) - "f" is the function name,
"2,3,4" is the operand Expression
.
UnaryOperation.getType()
is called, it
will return the ASCI-code for 'f' as a representative for any
FunctionCall
.operand, type
Constructor and Description |
---|
FunctionCall(Function function)
Creates a new
FunctionCall with the evaluation priority
pri and a functionName . |
FunctionCall(Function function,
List parameters)
Creates a new
FunctionCall with the evaluation priority
pri , a functionName and the operand
paramExp . |
Modifier and Type | Method and Description |
---|---|
Expression |
differentiate(Symbol s)
Returns the derivative of this function call.
|
Expression |
dissolveFunctionCalls()
Inserts all arguments of this FunctionCall into the function definition
and returns that new Expression.
|
boolean |
equals(Object o)
Returns
true if the specified Object is a
FunctionCall to the same funtion and with equal parameters,
false otherwise. |
Evaluator |
getEvaluator(Type defaultType,
Context context)
Returns the
Evaluator for this FunctionCall . |
String |
getFunctionName()
Returns the name of the
Function this FunctionCall
"is calling". |
int |
getParameterCount()
Returns the number of parameter values the operand
Expression
of this FunctionCall |
Expression |
simplify()
Simplifies this FunctionCall's operand (the parameter expression) and
returns a new FunctionCall with it.
|
String |
toString()
Returns a
String representing this
FunctionCall . |
getEssentialVariables, getOperand, getPriority, getType, isComplete, isConstant, replaceSymbol, setOperand
differentiate, getEssentialVariables
public FunctionCall(Function function)
FunctionCall
with the evaluation priority
pri
and a functionName
.
The operand of this FunctionCall
will be
null
until you call the method UnaryOperation.setOperand(Expression)
. Use the other constructor, if
the operand is already known.function
- The Function
this FunctionCall
is calling.public FunctionCall(Function function, List parameters)
FunctionCall
with the evaluation priority
pri
, a functionName
and the operand
paramExp
. Use the other constructor if the operand is not
known.function
- The Function
this FunctionCall
is calling.paramExp
- the operand (parameter Expression
) for this
FunctionCall
.public Expression differentiate(Symbol s)
differentiate
in class Expression
Function.getDerivative(int)
public Expression dissolveFunctionCalls()
dissolveFunctionCalls
in class UnaryOperation
Function.insertArguments(Expression)
public boolean equals(Object o)
true
if the specified Object
is a
FunctionCall
to the same funtion and with equal parameters,
false
otherwise.equals
in class UnaryOperation
o
- the object to compare this FunctionCall
against.true
if the specified Object
is a
FunctionCall
to the same funtion and with equal parameters,
false
otherwise.public Evaluator getEvaluator(Type defaultType, Context context)
Evaluator
for this FunctionCall
.
Type defaultType
specifies, how to deal with
Symbols
in the expression-tree-hirarchy (evaluate any
Symbol
as a Complex
or a Real
or
whatever?).getEvaluator
in class UnaryOperation
defaultType
- the Type
any Symbol
will be
evaluated to.context
- the Context
, the Evaluators for
the Symbols
are getting from.
Evaluator
for this FunctionCall
.FunctionCallEvaluator
public String getFunctionName()
Function
this FunctionCall
"is calling".Function
this FunctionCall
"is calling".Function.getName()
public int getParameterCount()
Expression
of this FunctionCall contains.
Expression
of this FunctionCall contains.
Function.getParameterCount()
public Expression simplify()
simplify
in class Expression
public String toString()
String
representing this
FunctionCall
. It's now possible to parse the
returned String
by a Parser
again.toString
in class UnaryOperation
String
representing this
FunctionCall
.