Class ExprConstantNodeImpl
java.lang.Object
com.espertech.esper.common.internal.epl.expression.core.ExprNodeBase
com.espertech.esper.common.internal.epl.expression.core.ExprConstantNodeImpl
- All Implemented Interfaces:
ExprConstantNode
,ExprEvaluator
,ExprForge
,ExprForgeInstrumentable
,ExprNode
,ExprNodeRenderable
,ExprValidator
public class ExprConstantNodeImpl
extends ExprNodeBase
implements ExprConstantNode, ExprEvaluator, ExprForgeInstrumentable
Represents a constant in an expressiun tree.
-
Field Summary
Fields inherited from interface com.espertech.esper.common.internal.epl.expression.core.ExprEvaluator
EPTYPE, EPTYPEARRAY
-
Constructor Summary
ConstructorDescriptionExprConstantNodeImpl
(EnumValue enumValue) ExprConstantNodeImpl
(Class type) Ctor - for use when the constant should return a given type and the actual value is always null.ExprConstantNodeImpl
(Object value) ExprConstantNodeImpl
(Object value, EPType valueType) ExprConstantNodeImpl
(Object value, Class valueType) ExprConstantNodeImpl
(Object value, String stringConstantWhenProvided) -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
equalsNode
(ExprNode node, boolean ignoreStreamPrefix) Return true if a expression node semantically equals the current node, or false if not.evaluate
(EventBean[] eventsPerStream, boolean isNewData, ExprEvaluatorContext exprEvaluatorContext) Evaluate event tuple and return result.evaluateCodegen
(EPTypeClass requiredType, CodegenMethodScope codegenMethodScope, ExprForgeCodegenSymbol exprSymbol, CodegenClassScope codegenClassScope) evaluateCodegenUninstrumented
(EPTypeClass requiredType, CodegenMethodScope codegenMethodScope, ExprForgeCodegenSymbol exprSymbol, CodegenClassScope codegenClassScope) Returns the constant's value.getForge()
Returns precedence.boolean
void
Sets the value of the constant.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
-
ExprConstantNodeImpl
-
ExprConstantNodeImpl
-
ExprConstantNodeImpl
-
ExprConstantNodeImpl
-
ExprConstantNodeImpl
-
ExprConstantNodeImpl
Ctor - for use when the constant should return a given type and the actual value is always null.- Parameters:
type
- the type of the constant null.
-
-
Method Details
-
getForgeConstantType
- Specified by:
getForgeConstantType
in interfaceExprForge
-
getExprEvaluator
- Specified by:
getExprEvaluator
in interfaceExprForge
-
getEvaluationType
- Specified by:
getEvaluationType
in interfaceExprForge
-
getForge
-
getStringConstantWhenProvided
- Specified by:
getStringConstantWhenProvided
in interfaceExprConstantNode
-
getForgeRenderable
- Specified by:
getForgeRenderable
in interfaceExprForge
-
constantAvailable
public boolean constantAvailable()- Specified by:
constantAvailable
in interfaceExprConstantNode
-
evaluateCodegen
public CodegenExpression evaluateCodegen(EPTypeClass requiredType, CodegenMethodScope codegenMethodScope, ExprForgeCodegenSymbol exprSymbol, CodegenClassScope codegenClassScope) - Specified by:
evaluateCodegen
in interfaceExprForge
-
evaluateCodegenUninstrumented
public CodegenExpression evaluateCodegenUninstrumented(EPTypeClass requiredType, CodegenMethodScope codegenMethodScope, ExprForgeCodegenSymbol exprSymbol, CodegenClassScope codegenClassScope) - Specified by:
evaluateCodegenUninstrumented
in interfaceExprForgeInstrumentable
-
validate
- Specified by:
validate
in interfaceExprValidator
- Throws:
ExprValidationException
-
isConstantResult
public boolean isConstantResult() -
getConstantValue
Returns the constant's value.- Specified by:
getConstantValue
in interfaceExprConstantNode
- Returns:
- value of constant
-
setValue
Sets the value of the constant.- Parameters:
value
- to set
-
getConstantType
- Specified by:
getConstantType
in interfaceExprConstantNode
-
evaluate
public Object evaluate(EventBean[] eventsPerStream, boolean isNewData, ExprEvaluatorContext exprEvaluatorContext) Description copied from interface:ExprEvaluator
Evaluate event tuple and return result.- Specified by:
evaluate
in interfaceExprEvaluator
- Parameters:
eventsPerStream
- - event tupleisNewData
- - indicates whether we are dealing with new data (istream) or old data (rstream)exprEvaluatorContext
- context for expression evaluation- Returns:
- evaluation result, a boolean value for OR/AND-type evalution nodes.
-
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
-