Package com.arcadedb.query.sql.parser
Class BaseExpression
- java.lang.Object
-
- com.arcadedb.query.sql.parser.SimpleNode
-
- com.arcadedb.query.sql.parser.MathExpression
-
- com.arcadedb.query.sql.parser.BaseExpression
-
- All Implemented Interfaces:
Node
public class BaseExpression extends MathExpression
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.arcadedb.query.sql.parser.MathExpression
MathExpression.Operator
-
-
Field Summary
Fields Modifier and Type Field Description protected BaseIdentifier
identifier
protected InputParameter
inputParam
protected boolean
isNull
protected Modifier
modifier
protected PNumber
number
protected String
string
-
Fields inherited from class com.arcadedb.query.sql.parser.MathExpression
childExpressions, operators
-
Fields inherited from class com.arcadedb.query.sql.parser.SimpleNode
cachedStringForm, children, value
-
-
Constructor Summary
Constructors Constructor Description BaseExpression(int id)
BaseExpression(Identifier identifier)
BaseExpression(Identifier identifier, Modifier modifier)
BaseExpression(RecordAttribute attr, Modifier modifier)
BaseExpression(String string)
-
Method Summary
-
Methods inherited from class com.arcadedb.query.sql.parser.MathExpression
getChildExpressions, getOperators, setChildExpressions
-
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, toString, toString
-
-
-
-
Field Detail
-
number
protected PNumber number
-
identifier
protected BaseIdentifier identifier
-
inputParam
protected InputParameter inputParam
-
string
protected String string
-
modifier
protected Modifier modifier
-
isNull
protected boolean isNull
-
-
Constructor Detail
-
BaseExpression
public BaseExpression(int id)
-
BaseExpression
public BaseExpression(Identifier identifier)
-
BaseExpression
public BaseExpression(String string)
-
BaseExpression
public BaseExpression(Identifier identifier, Modifier modifier)
-
BaseExpression
public BaseExpression(RecordAttribute attr, Modifier modifier)
-
-
Method Detail
-
setModifier
public void setModifier(Modifier modifier)
-
toString
public void toString(Map<String,Object> params, StringBuilder builder)
- Overrides:
toString
in classMathExpression
-
execute
public Object execute(Identifiable iCurrentRecord, CommandContext context)
- Overrides:
execute
in classMathExpression
-
execute
public Object execute(Result iCurrentRecord, CommandContext context)
- Overrides:
execute
in classMathExpression
-
isIndexedFunctionCall
public boolean isIndexedFunctionCall(CommandContext context)
- Overrides:
isIndexedFunctionCall
in classMathExpression
-
estimateIndexedFunction
public long estimateIndexedFunction(FromClause target, CommandContext context, BinaryCompareOperator operator, Object right)
- Overrides:
estimateIndexedFunction
in classMathExpression
-
executeIndexedFunction
public Iterable<Record> executeIndexedFunction(FromClause target, CommandContext context, BinaryCompareOperator operator, Object right)
- Overrides:
executeIndexedFunction
in classMathExpression
-
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- Overrides:
canExecuteIndexedFunctionWithoutIndex
in classMathExpression
- Parameters:
target
- the query targetcontext
- the execution contextoperator
-right
-- 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- Overrides:
allowsIndexedFunctionExecutionOnTarget
in classMathExpression
- Parameters:
target
- the query targetcontext
- the execution contextoperator
-right
-- 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- Overrides:
executeIndexedFunctionAfterIndexSearch
in classMathExpression
- 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()
- Overrides:
isBaseIdentifier
in classMathExpression
-
isEarlyCalculated
public boolean isEarlyCalculated(CommandContext context)
- Overrides:
isEarlyCalculated
in classMathExpression
-
isExpand
public boolean isExpand()
- Overrides:
isExpand
in classMathExpression
-
getExpandContent
public Expression getExpandContent()
- Overrides:
getExpandContent
in classMathExpression
-
isAggregate
public boolean isAggregate(CommandContext context)
- Overrides:
isAggregate
in classMathExpression
-
isCount
public boolean isCount()
- Overrides:
isCount
in classMathExpression
-
splitForAggregation
public SimpleNode splitForAggregation(AggregateProjectionSplit aggregateProj, CommandContext context)
- Overrides:
splitForAggregation
in classMathExpression
-
getAggregationContext
public AggregationContext getAggregationContext(CommandContext context)
- Overrides:
getAggregationContext
in classMathExpression
-
copy
public BaseExpression copy()
- Overrides:
copy
in classMathExpression
-
refersToParent
public boolean refersToParent()
- Overrides:
refersToParent
in classSimpleNode
-
setIdentifier
public void setIdentifier(BaseIdentifier identifier)
-
getIdentifier
public BaseIdentifier getIdentifier()
-
getModifier
public Modifier getModifier()
-
getMatchPatternInvolvedAliases
public List<String> getMatchPatternInvolvedAliases()
- Overrides:
getMatchPatternInvolvedAliases
in classMathExpression
-
applyRemove
public void applyRemove(ResultInternal result, CommandContext context)
- Overrides:
applyRemove
in classMathExpression
-
isDefinedFor
public boolean isDefinedFor(Result currentRecord)
- Overrides:
isDefinedFor
in classMathExpression
-
isDefinedFor
public boolean isDefinedFor(Record currentRecord)
- Overrides:
isDefinedFor
in classMathExpression
-
extractSubQueries
public void extractSubQueries(Identifier letAlias, SubQueryCollector collector)
- Overrides:
extractSubQueries
in classMathExpression
-
extractSubQueries
public void extractSubQueries(SubQueryCollector collector)
- Overrides:
extractSubQueries
in classMathExpression
-
getIdentityElements
protected Object[] getIdentityElements()
- Overrides:
getIdentityElements
in classMathExpression
-
getCacheableElements
protected SimpleNode[] getCacheableElements()
- Overrides:
getCacheableElements
in classMathExpression
-
setInputParam
public void setInputParam(InputParameter inputParam)
-
encode
public static String encode(String iText)
Transforms, only if needed, the source string escaping the characters \ and ".- Parameters:
iText
- Input String- Returns:
- Modified string if needed, otherwise the same input object
-
-