Class LogicalFilter<R>
java.lang.Object
org.apache.sis.internal.filter.Node
org.apache.sis.filter.FilterNode<R>
org.apache.sis.filter.LogicalFilter<R>
- Type Parameters:
R- the type of resources (e.g.Feature) used as inputs.
- All Implemented Interfaces:
Serializable, Predicate<R>, Filter<R>, Optimization.OnFilter<R>, LogicalOperator<R>
- Direct Known Subclasses:
LogicalFilter.And, LogicalFilter.Or
abstract class LogicalFilter<R>
extends FilterNode<R>
implements LogicalOperator<R>, Optimization.OnFilter<R>
Logical filter (AND, OR) using an arbitrary number of operands.
Operands are other filters.
- Since:
- 1.1
- Version:
- 1.2
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final classThe "And" operation (⋀).(package private) static final classThe negation filter (¬).(package private) static final classThe "Or" operation (⋁). -
Field Summary
FieldsModifier and TypeFieldDescriptionThe filter on which to apply the logical operator.private static final longFor cross-version compatibility. -
Constructor Summary
ConstructorsConstructorDescriptionLogicalFilter(Collection<? extends Filter<? super R>> op) Creates a new logical operator applied on the given operands.LogicalFilter(Filter<? super R> operand1, Filter<? super R> operand2) Creates a new logical operator with the two given operands. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract LogicalFilter<R> createSameType(Collection<? extends Filter<? super R>> op) Creates a new logical operator of the same kind than this operator.protected final Collection<?> Returns the children of this node for displaying purposes.Returns a list containing all of the child filters of this object.Returns the filter to use with duplicated operands removed, nested operations of the same type inlined, and literal values processed immediately.Methods inherited from class FilterNode
and, negate, orMethods inherited from class Node
createName, createType, equals, getGeometryLibrary, hashCode, symbol, toGeometryWrapper, toString, unwrap, warningMethods inherited from interface LogicalOperator
getExpressions, getOperatorType
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDFor cross-version compatibility.- See Also:
-
operands
-
-
Constructor Details
-
LogicalFilter
LogicalFilter(Collection<? extends Filter<? super R>> op) Creates a new logical operator applied on the given operands.- Parameters:
op- operands of the new operator.
-
LogicalFilter
-
-
Method Details
-
createSameType
Creates a new logical operator of the same kind than this operator.- Parameters:
op- operands of the new operator.- Returns:
- the new operator.
-
getOperands
Returns a list containing all of the child filters of this object.- Specified by:
getOperandsin interfaceLogicalOperator<R>
-
getChildren
Returns the children of this node for displaying purposes. This is used byNode.toString(),Node.hashCode()andNode.equals(Object)implementations.- Specified by:
getChildrenin classNode- Returns:
- the children of this node, or an empty collection if none.
-
optimize
final Filter<? super R> optimize(Optimization optimization, Filter<R> ignore, Filter<R> shortCircuit) Returns the filter to use with duplicated operands removed, nested operations of the same type inlined, and literal values processed immediately. If no simplification has been applied, then this method returnsthis.- Parameters:
optimization- the simplifications or optimizations to apply on this filter.ignore- the filter to ignore (literal "true" or "false").shortCircuit- the filter to use if found (literal "true" or "false").
-