Package org.apache.sis.filter
Interface Optimization.OnFilter<R>
- Type Parameters:
- R- the type of resources to filter.
- Enclosing class:
- Optimization
Filter that can be optimized. Each filter implementation knows which rules can be applied.
 For that reason, the optimization algorithms are kept in each implementation class.
 This interface allows 
Optimization to invoke that code.
 Implementations need to override only one of the 2 methods defined in this interface.
- 
Method SummaryModifier and TypeMethodDescriptionReturns theANDlogical operation between this filter and the given predicate.negate()Returns the logical negation of this filter.optimize(Optimization optimization) Tries to optimize this filter.Returns theORlogical operation between this filter and the given predicate.recreate(Expression<? super R, ?>[] effective) Creates a new filter of the same type and parameters than this filter, except for the expressions.Methods inherited from interface FiltergetExpressions, getOperatorType, test
- 
Method Details- 
optimizeTries to optimize this filter. The default implementation performs the following steps:- If all expressions are literals, evaluate this filter immediately.
- Otherwise if at least one child expression can be optimized, recreate the filter.
- Otherwise returns this.
 - Parameters:
- optimization- the simplifications or optimizations to apply on this filter.
- Returns:
- the simplified or optimized filter, or thisif no optimization has been applied.
 
- 
recreateCreates a new filter of the same type and parameters than this filter, except for the expressions. The expressions given to this method shall be equivalent to the expressions used by this filter, potentially more efficient.This method is used by the default implementation of optimize(Optimization)and can be ignored if above method is overridden.- Parameters:
- effective- the expressions to use as a replacement of this filter expressions.
- Returns:
- the new filter, or thisif unsupported.
 
- 
andReturns theANDlogical operation between this filter and the given predicate. If the given predicate is an instance ofFilter, then the returned predicate is an instance ofOptimization.OnFilter.
- 
orReturns theORlogical operation between this filter and the given predicate. If the given predicate is an instance ofFilter, then the returned predicate is an instance ofOptimization.OnFilter.
- 
negateReturns the logical negation of this filter. The returned predicate is an instance ofOptimization.OnFilter.
 
-