Package com.arcadedb.query.sql.parser
Class MathExpression
- java.lang.Object
-
- com.arcadedb.query.sql.parser.SimpleNode
-
- com.arcadedb.query.sql.parser.MathExpression
-
- All Implemented Interfaces:
Node
- Direct Known Subclasses:
BaseExpression
,FirstLevelExpression
,MultExpression
,ParenthesisExpression
public class MathExpression extends SimpleNode
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MathExpression.Operator
-
Field Summary
Fields Modifier and Type Field Description protected List<MathExpression>
childExpressions
protected List<MathExpression.Operator>
operators
-
Fields inherited from class com.arcadedb.query.sql.parser.SimpleNode
cachedStringForm, children, value
-
-
Constructor Summary
Constructors Constructor Description MathExpression(int id)
-
Method Summary
-
Methods inherited from class com.arcadedb.query.sql.parser.SimpleNode
equals, getValue, hashCode, isCacheable, jjtAddChild, jjtClose, jjtGetChild, jjtGetFirstToken, jjtGetLastToken, jjtGetNumChildren, jjtGetParent, jjtGetValue, jjtOpen, jjtSetFirstToken, jjtSetLastToken, jjtSetParent, jjtSetValue, refersToParent, toString, toString
-
-
-
-
Field Detail
-
childExpressions
protected List<MathExpression> childExpressions
-
operators
protected final List<MathExpression.Operator> operators
-
-
Method Detail
-
getExpandContent
public Expression getExpandContent()
-
isDefinedFor
public boolean isDefinedFor(Result currentRecord)
-
isDefinedFor
public boolean isDefinedFor(Record currentRecord)
-
getCacheableElements
protected SimpleNode[] getCacheableElements()
- Overrides:
getCacheableElements
in classSimpleNode
-
execute
public Object execute(Identifiable iCurrentRecord, CommandContext context)
-
execute
public Object execute(Result iCurrentRecord, CommandContext context)
-
getChildExpressions
public List<MathExpression> getChildExpressions()
-
setChildExpressions
public void setChildExpressions(List<MathExpression> childExpressions)
-
getOperators
public List<MathExpression.Operator> getOperators()
-
toString
public void toString(Map<String,Object> params, StringBuilder builder)
- Overrides:
toString
in classSimpleNode
-
isIndexedFunctionCall
public boolean isIndexedFunctionCall(CommandContext context)
-
estimateIndexedFunction
public long estimateIndexedFunction(FromClause target, CommandContext context, BinaryCompareOperator operator, Object right)
-
executeIndexedFunction
public Iterable<Record> executeIndexedFunction(FromClause target, CommandContext context, BinaryCompareOperator operator, Object right)
-
canExecuteIndexedFunctionWithoutIndex
public boolean canExecuteIndexedFunctionWithoutIndex(FromClause target, CommandContext context, BinaryCompareOperator operator, Object right)
tests if current expression is an indexed function AND that function can also be executed without using the index- Parameters:
target
- the query targetcontext
- the execution context- Returns:
- true if current expression is an indexed function AND that function can also be executed without using the index, false otherwise
-
allowsIndexedFunctionExecutionOnTarget
public boolean allowsIndexedFunctionExecutionOnTarget(FromClause target, CommandContext context, BinaryCompareOperator operator, Object right)
tests if current expression is an indexed function AND that function can be used on this target- Parameters:
target
- the query targetcontext
- the execution context- Returns:
- true if current expression is an indexed function AND that function can be used on this target, false otherwise
-
executeIndexedFunctionAfterIndexSearch
public boolean executeIndexedFunctionAfterIndexSearch(FromClause target, CommandContext context, BinaryCompareOperator operator, Object right)
tests if current expression is an indexed function AND the function has also to be executed after the index search. In some cases, the index search is accurate, so this condition can be excluded from further evaluation. In other cases the result from the index is a superset of the expected result, so the function has to be executed anyway for further filtering- Parameters:
target
- the query targetcontext
- the execution context- Returns:
- true if current expression is an indexed function AND the function has also to be executed after the index search.
-
isBaseIdentifier
public boolean isBaseIdentifier()
-
isExpand
public boolean isExpand()
-
isEarlyCalculated
public boolean isEarlyCalculated(CommandContext context)
-
isAggregate
public boolean isAggregate(CommandContext context)
-
isCount
public boolean isCount()
-
splitForAggregation
public SimpleNode splitForAggregation(AggregateProjectionSplit aggregateProj, CommandContext context)
-
getAggregationContext
public AggregationContext getAggregationContext(CommandContext context)
-
copy
public MathExpression copy()
- Overrides:
copy
in classSimpleNode
-
extractSubQueries
public void extractSubQueries(Identifier letAlias, SubQueryCollector collector)
-
extractSubQueries
public void extractSubQueries(SubQueryCollector collector)
-
getIdentityElements
protected Object[] getIdentityElements()
- Overrides:
getIdentityElements
in classSimpleNode
-
applyRemove
public void applyRemove(ResultInternal result, CommandContext context)
-
-