Package com.arcadedb.query.sql.parser
Class BooleanExpression
- java.lang.Object
-
- com.arcadedb.query.sql.parser.SimpleNode
-
- com.arcadedb.query.sql.parser.BooleanExpression
-
- All Implemented Interfaces:
Node
- Direct Known Subclasses:
AndBlock
,BetweenCondition
,BinaryCondition
,ContainsAllCondition
,ContainsAnyCondition
,ContainsCondition
,ContainsTextCondition
,ContainsValueCondition
,InCondition
,IndexMatchCondition
,InstanceofCondition
,IsDefinedCondition
,IsNotDefinedCondition
,IsNotNullCondition
,IsNullCondition
,MatchesCondition
,NotBlock
,NotInCondition
,OrBlock
,ParenthesisBlock
public abstract class BooleanExpression extends SimpleNode
Created by luigidellaquila on 07/11/14.
-
-
Field Summary
Fields Modifier and Type Field Description static BooleanExpression
FALSE
static BooleanExpression
TRUE
-
Fields inherited from class com.arcadedb.query.sql.parser.SimpleNode
children, firstToken, id, lastToken, parent, parser, value
-
-
Constructor Summary
Constructors Constructor Description BooleanExpression(int id)
BooleanExpression(SqlParser p, int id)
-
Method Summary
-
Methods inherited from class com.arcadedb.query.sql.parser.SimpleNode
childrenAccept, dump, getValue, jjtAccept, jjtAddChild, jjtClose, jjtGetChild, jjtGetFirstToken, jjtGetLastToken, jjtGetNumChildren, jjtGetParent, jjtGetValue, jjtOpen, jjtSetFirstToken, jjtSetLastToken, jjtSetParent, jjtSetValue, toString, toString, toString
-
-
-
-
Field Detail
-
TRUE
public static final BooleanExpression TRUE
-
FALSE
public static final BooleanExpression FALSE
-
-
Constructor Detail
-
BooleanExpression
public BooleanExpression(int id)
-
BooleanExpression
public BooleanExpression(SqlParser p, int id)
-
-
Method Detail
-
evaluate
public abstract boolean evaluate(Identifiable currentRecord, CommandContext ctx)
-
evaluate
public abstract boolean evaluate(Result currentRecord, CommandContext ctx)
-
supportsBasicCalculation
protected abstract boolean supportsBasicCalculation()
- Returns:
- true if this expression can be calculated in plain Java, false otherwise
-
getNumberOfExternalCalculations
protected abstract int getNumberOfExternalCalculations()
- Returns:
- the number of sub-expressions that have to be calculated using an external engine
-
getExternalCalculationConditions
protected abstract List<Object> getExternalCalculationConditions()
- Returns:
- the sub-expressions that have to be calculated using an external engine
-
getIndexedFunctionConditions
public List<BinaryCondition> getIndexedFunctionConditions(DocumentType iSchemaClass, Database database)
-
encapsulateInAndBlock
protected AndBlock encapsulateInAndBlock(BooleanExpression item)
-
copy
public abstract BooleanExpression copy()
- Overrides:
copy
in classSimpleNode
-
isEmpty
public boolean isEmpty()
-
extractSubQueries
public abstract void extractSubQueries(SubQueryCollector collector)
-
refersToParent
public abstract boolean refersToParent()
-
transformToUpdateItem
public Optional<UpdateItem> transformToUpdateItem()
returns the equivalent of current condition as an UPDATE expression with the same syntax, if possible.Eg. name = 3 can be considered a condition or an assignment. This method transforms the condition in an assignment. This is used mainly for UPSERT operations.
- Returns:
- the equivalent of current condition as an UPDATE expression with the same syntax, if possible.
-
deserializeFromOResult
public static BooleanExpression deserializeFromOResult(Result doc)
-
serialize
public Result serialize()
-
deserialize
public void deserialize(Result fromResult)
-
isCacheable
public abstract boolean isCacheable()
-
-