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
cachedStringForm, children, value
-
-
Constructor Summary
Constructors Constructor Description BooleanExpression(int id)
-
Method Summary
-
Methods inherited from class com.arcadedb.query.sql.parser.SimpleNode
equals, getCacheableElements, getIdentityElements, getValue, hashCode, isCacheable, jjtAddChild, jjtClose, jjtGetChild, jjtGetFirstToken, jjtGetLastToken, jjtGetNumChildren, jjtGetParent, jjtGetValue, jjtOpen, jjtSetFirstToken, jjtSetLastToken, jjtSetParent, jjtSetValue, refersToParent, toString, toString, toString
-
-
-
-
Field Detail
-
TRUE
public static final BooleanExpression TRUE
-
FALSE
public static final BooleanExpression FALSE
-
-
Method Detail
-
evaluate
public abstract Boolean evaluate(Identifiable currentRecord, CommandContext context)
-
evaluate
public abstract Boolean evaluate(Result currentRecord, CommandContext context)
-
getIndexedFunctionConditions
public List<BinaryCondition> getIndexedFunctionConditions(DocumentType iSchemaClass, CommandContext context)
-
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)
-
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.
-
createRangeWith
public boolean createRangeWith(BooleanExpression match)
-
isAlwaysTrue
public boolean isAlwaysTrue()
returns true only if the expression does not need any further evaluation (eg. "true") and always evaluates to true. It is supposed to be used as and optimization, and is allowed to return false negatives- Returns:
-
isIndexAware
public boolean isIndexAware(IndexSearchInfo info)
-
resolveKeyFrom
public Expression resolveKeyFrom(BinaryCondition additional)
-
resolveKeyTo
public Expression resolveKeyTo(BinaryCondition additional)
-
-