Class SelectionClauseWriter.Logic
java.lang.Object
org.apache.sis.internal.sql.feature.SelectionClauseWriter.Logic
- All Implemented Interfaces:
BiConsumer<Filter<AbstractFeature>,
SelectionClause>
- Enclosing class:
SelectionClauseWriter
private final class SelectionClauseWriter.Logic
extends Object
implements BiConsumer<Filter<AbstractFeature>,SelectionClause>
Handler for converting an
AND
, OR
or NOT
filter into SQL clauses.
The filter can contain an arbitrary number of operands, all separated by the same keyword.
All operands are grouped between parenthesis.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
accept
(Filter<AbstractFeature> f, SelectionClause sql) Invoked when a logical filter needs to be converted to SQL clause.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.function.BiConsumer
andThen
-
Field Details
-
operator
TheAND
,OR
orNOT
keyword. Shall contain a trailing space and eventually a leading space. -
unary
private final boolean unaryWhether this operator is the unary operator. In that case exactly one operand is expected and the keyword will be written before the operand instead of between the operands.
-
-
Constructor Details
-
Logic
Logic(String operator, boolean unary) Creates a handler using the given SQL keyword.
-
-
Method Details
-
accept
Invoked when a logical filter needs to be converted to SQL clause.- Specified by:
accept
in interfaceBiConsumer<Filter<AbstractFeature>,
SelectionClause>
-