public abstract class GenericCalc extends AbstractCalc implements TupleCalc, StringCalc, IntegerCalc, DoubleCalc, BooleanCalc, DateTimeCalc, VoidCalc, MemberCalc, LevelCalc, HierarchyCalc, DimensionCalc
GenericIterCalc
exp, type
Modifier | Constructor and Description |
---|---|
protected |
GenericCalc(Exp exp)
Creates a GenericCalc without specifying child calculated expressions.
|
protected |
GenericCalc(Exp exp,
Calc[] calcs)
Creates an GenericCalc.
|
Modifier and Type | Method and Description |
---|---|
boolean |
evaluateBoolean(Evaluator evaluator)
Evaluates this expression to yield a
boolean value. |
Date |
evaluateDateTime(Evaluator evaluator)
Evaluates this expression to yield a
Date value. |
Dimension |
evaluateDimension(Evaluator evaluator)
Evaluates this expression to yield a dimension.
|
double |
evaluateDouble(Evaluator evaluator)
Evaluates this expression to yield a
double value. |
Hierarchy |
evaluateHierarchy(Evaluator evaluator)
Evaluates this expression to yield a hierarchy.
|
int |
evaluateInteger(Evaluator evaluator)
Evaluates this expression to yield an
int value. |
Level |
evaluateLevel(Evaluator evaluator)
Evaluates this expression to yield a level.
|
Member |
evaluateMember(Evaluator evaluator)
Evaluates this expression to yield a member.
|
String |
evaluateString(Evaluator evaluator)
Evaluates this expression to yield a
String value. |
Member[] |
evaluateTuple(Evaluator evaluator)
Evaluates this expression to yield a tuple.
|
void |
evaluateVoid(Evaluator evaluator) |
static double |
numberToDouble(Number number) |
accept, anyDepends, anyDependsButFirst, butDepends, collectArguments, dependsOn, getArguments, getCalcs, getName, getResultStyle, getType, isWrapperFor, simplifyEvaluator, unwrap
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
accept, dependsOn, evaluate, getResultStyle, getType, isWrapperFor, unwrap
protected GenericCalc(Exp exp)
Subclass should override AbstractCalc.getCalcs()
.
exp
- Source expressionpublic Member[] evaluateTuple(Evaluator evaluator)
TupleCalc
A tuple cannot contain any null members. If any of the members is null, this method must return a null.
evaluateTuple
in interface TupleCalc
evaluator
- Evaluation contextpublic String evaluateString(Evaluator evaluator)
StringCalc
String
value.evaluateString
in interface StringCalc
evaluator
- Evaluation contextpublic int evaluateInteger(Evaluator evaluator)
IntegerCalc
int
value.
If the result is null, returns the special
FunUtil.IntegerNull
value.evaluateInteger
in interface IntegerCalc
evaluator
- Evaluation contextpublic double evaluateDouble(Evaluator evaluator)
DoubleCalc
double
value.
If the result is null, returns the special
FunUtil.DoubleNull
value.evaluateDouble
in interface DoubleCalc
evaluator
- Evaluation contextpublic static double numberToDouble(Number number)
public boolean evaluateBoolean(Evaluator evaluator)
BooleanCalc
boolean
value.
If the result is null, returns the special
FunUtil.BooleanNull
value.evaluateBoolean
in interface BooleanCalc
evaluator
- Evaluation contextpublic Date evaluateDateTime(Evaluator evaluator)
DateTimeCalc
Date
value.evaluateDateTime
in interface DateTimeCalc
evaluator
- Evaluation contextpublic void evaluateVoid(Evaluator evaluator)
evaluateVoid
in interface VoidCalc
public Member evaluateMember(Evaluator evaluator)
MemberCalc
May return the null member (see
Hierarchy.getNullMember()
) but never null.
evaluateMember
in interface MemberCalc
evaluator
- Evaluation contextpublic Level evaluateLevel(Evaluator evaluator)
LevelCalc
Never returns null.
evaluateLevel
in interface LevelCalc
evaluator
- Evaluation contextpublic Hierarchy evaluateHierarchy(Evaluator evaluator)
HierarchyCalc
Never returns null.
evaluateHierarchy
in interface HierarchyCalc
evaluator
- Evaluation contextpublic Dimension evaluateDimension(Evaluator evaluator)
DimensionCalc
Never returns null.
evaluateDimension
in interface DimensionCalc
evaluator
- Evaluation contextCopyright © 2020 Hitachi Vantara. All rights reserved.