public class ExprTimePeriodImpl extends ExprNodeBase implements ExprTimePeriod, ExprEvaluator
Child nodes to this expression carry the actual parts and must return a numeric value.
Modifier and Type | Class and Description |
---|---|
static interface |
ExprTimePeriodImpl.TimePeriodAdder |
static class |
ExprTimePeriodImpl.TimePeriodAdderDay |
static class |
ExprTimePeriodImpl.TimePeriodAdderHour |
static class |
ExprTimePeriodImpl.TimePeriodAdderMinute |
static class |
ExprTimePeriodImpl.TimePeriodAdderMonth |
static class |
ExprTimePeriodImpl.TimePeriodAdderMSec |
static class |
ExprTimePeriodImpl.TimePeriodAdderSecond |
static class |
ExprTimePeriodImpl.TimePeriodAdderUSec |
static class |
ExprTimePeriodImpl.TimePeriodAdderWeek |
static class |
ExprTimePeriodImpl.TimePeriodAdderYear |
Constructor and Description |
---|
ExprTimePeriodImpl(TimeZone timeZone,
boolean hasYear,
boolean hasMonth,
boolean hasWeek,
boolean hasDay,
boolean hasHour,
boolean hasMinute,
boolean hasSecond,
boolean hasMillisecond,
boolean hasMicrosecond,
TimeAbacus timeAbacus) |
Modifier and Type | Method and Description |
---|---|
ExprTimePeriodEvalDeltaConst |
constEvaluator(ExprEvaluatorContext context) |
boolean |
equalsNode(ExprNode node,
boolean ignoreStreamPrefix)
Return true if a expression node semantically equals the current node, or false if not.
|
Object |
evaluate(EventBean[] eventsPerStream,
boolean isNewData,
ExprEvaluatorContext context)
Evaluate event tuple and return result.
|
double |
evaluateAsSeconds(EventBean[] eventsPerStream,
boolean newData,
ExprEvaluatorContext context) |
TimePeriod |
evaluateGetTimePeriod(EventBean[] eventsPerStream,
boolean newData,
ExprEvaluatorContext context) |
protected ExprTimePeriodImpl.TimePeriodAdder[] |
getAdders() |
ExprEvaluator[] |
getEvaluators() |
ExprEvaluator |
getExprEvaluator() |
ExprPrecedenceEnum |
getPrecedence()
Returns precedence.
|
TimeAbacus |
getTimeAbacus() |
Class |
getType()
Returns the type that the node's evaluate method returns an instance of.
|
boolean |
hasVariable()
Indicator whether the time period has a variable in any of the child expressions.
|
boolean |
isConstantResult()
Returns true if the expression node's evaluation value doesn't depend on any events data,
as must be determined at validation time, which is bottom-up and therefore
reliably allows each node to determine constant value.
|
boolean |
isHasDay()
Indicator whether the time period has a day part child expression.
|
boolean |
isHasHour()
Indicator whether the time period has a hour part child expression.
|
boolean |
isHasMicrosecond()
Indicator whether the time period has a microsecond part child expression.
|
boolean |
isHasMillisecond()
Indicator whether the time period has a millisecond part child expression.
|
boolean |
isHasMinute()
Indicator whether the time period has a minute part child expression.
|
boolean |
isHasMonth()
Indicator whether the time period has a month part child expression.
|
boolean |
isHasSecond()
Indicator whether the time period has a second part child expression.
|
boolean |
isHasWeek()
Indicator whether the time period has a week part child expression.
|
boolean |
isHasYear()
Indicator whether the time period has a year part child expression.
|
ExprTimePeriodEvalDeltaNonConst |
nonconstEvaluator() |
void |
toPrecedenceFreeEPL(StringWriter writer) |
ExprNode |
validate(ExprValidationContext validationContext) |
accept, accept, acceptChildnodes, addChildNode, addChildNodes, addChildNodeToFront, getChildNodes, replaceUnlistedChildNode, setChildNode, setChildNodes, toEPL
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
accept, accept, acceptChildnodes, addChildNode, addChildNodes, getChildNodes, replaceUnlistedChildNode, setChildNode, setChildNodes, toEPL
public ExprTimePeriodImpl(TimeZone timeZone, boolean hasYear, boolean hasMonth, boolean hasWeek, boolean hasDay, boolean hasHour, boolean hasMinute, boolean hasSecond, boolean hasMillisecond, boolean hasMicrosecond, TimeAbacus timeAbacus)
public ExprTimePeriodEvalDeltaConst constEvaluator(ExprEvaluatorContext context)
constEvaluator
in interface ExprTimePeriod
public ExprTimePeriodEvalDeltaNonConst nonconstEvaluator()
nonconstEvaluator
in interface ExprTimePeriod
public TimeAbacus getTimeAbacus()
public ExprEvaluator getExprEvaluator()
getExprEvaluator
in interface ExprNode
public Object evaluate(EventBean[] eventsPerStream, boolean isNewData, ExprEvaluatorContext context)
ExprEvaluator
evaluate
in interface ExprEvaluator
eventsPerStream
- - event tupleisNewData
- - indicates whether we are dealing with new data (istream) or old data (rstream)context
- context for expression evaluationprotected ExprTimePeriodImpl.TimePeriodAdder[] getAdders()
public ExprEvaluator[] getEvaluators()
public boolean isHasDay()
isHasDay
in interface ExprTimePeriod
public boolean isHasHour()
isHasHour
in interface ExprTimePeriod
public boolean isHasMinute()
isHasMinute
in interface ExprTimePeriod
public boolean isHasSecond()
isHasSecond
in interface ExprTimePeriod
public boolean isHasMillisecond()
isHasMillisecond
in interface ExprTimePeriod
public boolean isHasMicrosecond()
ExprTimePeriod
isHasMicrosecond
in interface ExprTimePeriod
public boolean isHasYear()
isHasYear
in interface ExprTimePeriod
public boolean isHasMonth()
isHasMonth
in interface ExprTimePeriod
public boolean isHasWeek()
isHasWeek
in interface ExprTimePeriod
public boolean hasVariable()
hasVariable
in interface ExprTimePeriod
public ExprNode validate(ExprValidationContext validationContext) throws ExprValidationException
validate
in interface ExprValidator
ExprValidationException
public double evaluateAsSeconds(EventBean[] eventsPerStream, boolean newData, ExprEvaluatorContext context)
evaluateAsSeconds
in interface ExprTimePeriod
public TimePeriod evaluateGetTimePeriod(EventBean[] eventsPerStream, boolean newData, ExprEvaluatorContext context)
evaluateGetTimePeriod
in interface ExprTimePeriod
public Class getType()
ExprEvaluator
getType
in interface ExprEvaluator
public boolean isConstantResult()
ExprNode
isConstantResult
in interface ExprNode
isConstantResult
in interface ExprTimePeriod
public void toPrecedenceFreeEPL(StringWriter writer)
toPrecedenceFreeEPL
in class ExprNodeBase
public ExprPrecedenceEnum getPrecedence()
ExprNode
getPrecedence
in interface ExprNode
public boolean equalsNode(ExprNode node, boolean ignoreStreamPrefix)
ExprNode
Concrete implementations should compare the type and any additional information that impact the evaluation of a node.
equalsNode
in interface ExprNode
node
- to compare toignoreStreamPrefix
- when the equals-comparison can ignore prefix of event properties