public interface Type
Types
the result of
an evaluation can be.
This interface provides methods to get the appropriate Evaluator
for
a certain Expression
in relation to the Type
to what all
is evaluated, e.g.:
Real * Real = Real
Real * Complex = Complex
Complex * Complex = Complex
ComplexVector * Complex = ComplexVector
...
getRepresentationClass()
returns the Class
of evaluation result this Type
is representing.Evaluator.getReturnType()
Modifier and Type | Method and Description |
---|---|
Variable |
createVariable(String name,
Object value)
Create and return a new
Variable . |
Evaluator |
getEvaluator(BinaryOperation bo,
Evaluator e1,
Evaluator e2)
Return the
Evaluator for the specified
BinaryOperation . |
Evaluator |
getEvaluator(FunctionCall fc,
Context context)
Return the
Evaluator for the specified
FunctionCall . |
Evaluator |
getEvaluator(List l,
Evaluator[] entryEval)
Return the
Evaluator for the specified List . |
Evaluator |
getEvaluator(PredefinedFunction pf,
Evaluator paramEval)
Return the
Evaluator for the specified
PredefinedFunction . |
Evaluator |
getEvaluator(Symbol s,
Context context)
Return the
Evaluator for the specified Symbol . |
Evaluator |
getEvaluator(UnaryOperation uo,
Evaluator e)
Return the
Evaluator for the specified
UnaryOperation . |
Class |
getRepresentationClass()
Return the
Class this Type is representing. |
Variable createVariable(String name, Object value)
Variable
.name
- the name of the Variable
to be created.value
- the value of the Variable
to be created.Variable
.Evaluator getEvaluator(BinaryOperation bo, Evaluator e1, Evaluator e2)
Evaluator
for the specified
BinaryOperation
.bo
- the BinaryOperation
the Evaluator
is to be returned for.e1
- the Evaluator
for the first operand of the
BinaryOperation
.e2
- the Evaluator
for the second operand of the
BinaryOperation
.Evaluator
for the specified BinaryOperation.Evaluator getEvaluator(FunctionCall fc, Context context)
Evaluator
for the specified
FunctionCall
.fc
- the FunctionCall
the Evaluator
is to be returned for.context
- the evaluation Context
the function's
parameters depending on (e.g.: nested function calls).Evaluator
for the specified
FunctionCall
.Evaluator getEvaluator(List l, Evaluator[] entryEval)
Evaluator
for the specified List
.l
- the List
the Evaluator
is to be returned for.entryEval
- an array of all Evaluator
for the list
entries.Evaluator
for the specified List
.List.getEntries()
Evaluator getEvaluator(PredefinedFunction pf, Evaluator paramEval)
Evaluator
for the specified
PredefinedFunction
.
Note that a PredefinedFunction
is no
Expression
. It's necessary to call this method
after getEvaluator(FunctionCall,Context)
has created
a new FunctionCallEvaluator
which itself calls
PredefinedFunction.getCallEvaluator(Type,Context)
-
a PredefinedFunction
call preconditioned.
pf
- the PredefinedFunction
the Evaluator
is to be returned for.paramEval
- the Evaluator
for the
function's parameter.Evaluator
for the specified
PredefinedFunction
.Evaluator getEvaluator(Symbol s, Context context)
Evaluator
for the specified Symbol
.
An Evaluator
for a Symbol
will be either a
Variable
or a Constant
.s
- the Symbol
the Evaluator
is to be returned for.context
- the Context
the Evaluator
will be got from.Evaluator
for the specified Symbol
.Context.getEvaluator(Symbol)
Evaluator getEvaluator(UnaryOperation uo, Evaluator e)
Evaluator
for the specified
UnaryOperation
.uo
- the UnaryOperation
the Evaluator
is to be returned for.e
- the Evaluator
for the operand of the
UnaryOperation
.Evaluator
for the specified
UnaryOperation
.Class getRepresentationClass()
Class
this Type
is representing.Class
this Type
is representing.