Class ExprTimePeriodImpl
java.lang.Object
com.espertech.esper.common.internal.epl.expression.core.ExprNodeBase
com.espertech.esper.common.internal.epl.expression.time.node.ExprTimePeriodImpl
- All Implemented Interfaces:
ExprNode
,ExprNodeRenderable
,ExprValidator
,TimePeriodEval
,ExprTimePeriod
Expression representing a time period.
Child nodes to this expression carry the actual parts and must return a numeric value.
-
Field Summary
Fields inherited from interface com.espertech.esper.common.internal.epl.expression.time.eval.TimePeriodEval
EPTYPE
-
Constructor Summary
ConstructorDescriptionExprTimePeriodImpl
(boolean hasYear, boolean hasMonth, boolean hasWeek, boolean hasDay, boolean hasHour, boolean hasMinute, boolean hasSecond, boolean hasMillisecond, boolean hasMicrosecond, TimeAbacus timeAbacus) -
Method Summary
Modifier and TypeMethodDescriptionboolean
equalsNode
(ExprNode node, boolean ignoreStreamPrefix) Return true if a expression node semantically equals the current node, or false if not.double
evaluateAsSeconds
(EventBean[] eventsPerStream, boolean newData, ExprEvaluatorContext context) evaluateAsSecondsCodegen
(CodegenMethodScope codegenMethodScope, ExprForgeCodegenSymbol exprSymbol, CodegenClassScope codegenClassScope) evaluateGetTimePeriod
(EventBean[] eventsPerStream, boolean newData, ExprEvaluatorContext context) evaluateGetTimePeriodCodegen
(CodegenMethodScope codegenMethodScope, ExprForgeCodegenSymbol exprSymbol, CodegenClassScope codegenClassScope) getForge()
Returns precedence.boolean
Indicator whether the time period has a variable in any of the child expressions.boolean
boolean
isHasDay()
Indicator whether the time period has a day part child expression.boolean
Indicator whether the time period has a hour part child expression.boolean
Indicator whether the time period has a microsecond part child expression.boolean
Indicator whether the time period has a millisecond part child expression.boolean
Indicator whether the time period has a minute part child expression.boolean
Indicator whether the time period has a month part child expression.boolean
Indicator whether the time period has a second part child expression.boolean
Indicator whether the time period has a week part child expression.boolean
Indicator whether the time period has a year part child expression.makeTimePeriodAnonymous
(CodegenMethod method, CodegenClassScope classScope) timePeriodEval
(EventBean[] eventsPerStream, boolean isNewData, ExprEvaluatorContext exprEvaluatorContext) void
toPrecedenceFreeEPL
(StringWriter writer, ExprNodeRenderableFlags flags) validate
(ExprValidationContext validationContext) Methods inherited from class com.espertech.esper.common.internal.epl.expression.core.ExprNodeBase
accept, accept, acceptChildnodes, addChildNode, addChildNodes, addChildNodeToFront, checkValidated, checkValidatedException, getChildNodes, replaceUnlistedChildNode, setChildNode, setChildNodes, toEPL
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.espertech.esper.common.internal.epl.expression.core.ExprNode
accept, accept, acceptChildnodes, addChildNode, addChildNodes, getChildNodes, replaceUnlistedChildNode, setChildNode, setChildNodes
Methods inherited from interface com.espertech.esper.common.internal.epl.expression.core.ExprNodeRenderable
toEPL
-
Constructor Details
-
ExprTimePeriodImpl
public ExprTimePeriodImpl(boolean hasYear, boolean hasMonth, boolean hasWeek, boolean hasDay, boolean hasHour, boolean hasMinute, boolean hasSecond, boolean hasMillisecond, boolean hasMicrosecond, TimeAbacus timeAbacus)
-
-
Method Details
-
getForge
-
getExprEvaluator
-
getTimePeriodEval
- Specified by:
getTimePeriodEval
in interfaceExprTimePeriod
-
getTimePeriodComputeForge
- Specified by:
getTimePeriodComputeForge
in interfaceExprTimePeriod
-
evaluateGetTimePeriodCodegen
public CodegenExpression evaluateGetTimePeriodCodegen(CodegenMethodScope codegenMethodScope, ExprForgeCodegenSymbol exprSymbol, CodegenClassScope codegenClassScope) - Specified by:
evaluateGetTimePeriodCodegen
in interfaceExprTimePeriod
-
makeTimePeriodAnonymous
public CodegenExpression makeTimePeriodAnonymous(CodegenMethod method, CodegenClassScope classScope) - Specified by:
makeTimePeriodAnonymous
in interfaceExprTimePeriod
-
evaluateAsSecondsCodegen
public CodegenExpression evaluateAsSecondsCodegen(CodegenMethodScope codegenMethodScope, ExprForgeCodegenSymbol exprSymbol, CodegenClassScope codegenClassScope) - Specified by:
evaluateAsSecondsCodegen
in interfaceExprTimePeriod
-
hasVariable
public boolean hasVariable()Indicator whether the time period has a variable in any of the child expressions.- Specified by:
hasVariable
in interfaceExprTimePeriod
- Returns:
- true for variable present, false for not present
-
evaluateGetTimePeriod
public TimePeriod evaluateGetTimePeriod(EventBean[] eventsPerStream, boolean newData, ExprEvaluatorContext context) - Specified by:
evaluateGetTimePeriod
in interfaceExprTimePeriod
-
evaluateAsSeconds
public double evaluateAsSeconds(EventBean[] eventsPerStream, boolean newData, ExprEvaluatorContext context) - Specified by:
evaluateAsSeconds
in interfaceExprTimePeriod
-
getTimeAbacus
-
isHasDay
public boolean isHasDay()Indicator whether the time period has a day part child expression.- Specified by:
isHasDay
in interfaceExprTimePeriod
- Returns:
- true for part present, false for not present
-
isHasHour
public boolean isHasHour()Indicator whether the time period has a hour part child expression.- Specified by:
isHasHour
in interfaceExprTimePeriod
- Returns:
- true for part present, false for not present
-
isHasMinute
public boolean isHasMinute()Indicator whether the time period has a minute part child expression.- Specified by:
isHasMinute
in interfaceExprTimePeriod
- Returns:
- true for part present, false for not present
-
isHasSecond
public boolean isHasSecond()Indicator whether the time period has a second part child expression.- Specified by:
isHasSecond
in interfaceExprTimePeriod
- Returns:
- true for part present, false for not present
-
isHasMillisecond
public boolean isHasMillisecond()Indicator whether the time period has a millisecond part child expression.- Specified by:
isHasMillisecond
in interfaceExprTimePeriod
- Returns:
- true for part present, false for not present
-
isHasMicrosecond
public boolean isHasMicrosecond()Description copied from interface:ExprTimePeriod
Indicator whether the time period has a microsecond part child expression.- Specified by:
isHasMicrosecond
in interfaceExprTimePeriod
- Returns:
- true for part present, false for not present
-
isHasYear
public boolean isHasYear()Indicator whether the time period has a year part child expression.- Specified by:
isHasYear
in interfaceExprTimePeriod
- Returns:
- true for part present, false for not present
-
isHasMonth
public boolean isHasMonth()Indicator whether the time period has a month part child expression.- Specified by:
isHasMonth
in interfaceExprTimePeriod
- Returns:
- true for part present, false for not present
-
isHasWeek
public boolean isHasWeek()Indicator whether the time period has a week part child expression.- Specified by:
isHasWeek
in interfaceExprTimePeriod
- Returns:
- true for part present, false for not present
-
validate
- Specified by:
validate
in interfaceExprValidator
- Throws:
ExprValidationException
-
isConstantResult
public boolean isConstantResult()- Specified by:
isConstantResult
in interfaceExprTimePeriod
-
toPrecedenceFreeEPL
- Specified by:
toPrecedenceFreeEPL
in classExprNodeBase
-
getPrecedence
Description copied from interface:ExprNode
Returns precedence.- Specified by:
getPrecedence
in interfaceExprNode
- Returns:
- precedence
-
equalsNode
Description copied from interface:ExprNode
Return true if a expression node semantically equals the current node, or false if not.Concrete implementations should compare the type and any additional information that impact the evaluation of a node.
- Specified by:
equalsNode
in interfaceExprNode
- Parameters:
node
- to compare toignoreStreamPrefix
- when the equals-comparison can ignore prefix of event properties- Returns:
- true if semantically equal, or false if not equals
-
timePeriodEval
public TimePeriod timePeriodEval(EventBean[] eventsPerStream, boolean isNewData, ExprEvaluatorContext exprEvaluatorContext) - Specified by:
timePeriodEval
in interfaceTimePeriodEval
-