public class TLcyCompositeAndFilter<T> extends ALcyCompositeFilter<T>
Implementation of ALcyCompositeFilter
that logically ands the
associated filters together. This means that accept
will only
return true if the given object is accepted by all associated filters.
The filters are evaluated in the order in which they were added. This doesn't have any impact on the result, but it might have a performance impact.
Constructor and Description |
---|
TLcyCompositeAndFilter()
Constructs a new
TLcyCompositeAndFilter , having no associated
ILcdFilter s. |
TLcyCompositeAndFilter(ILcdFilter<T>... aFilters)
Constructs a new
TLcyCompositeAndFilter populated with aFilters . |
Modifier and Type | Method and Description |
---|---|
boolean |
accept(T aObject)
Returns true if all associated
ILcdFilter s accept the given Object
or if no ILcdFilter s are associated. |
addChangeListener, addFilter, fireChangeEvent, getFilter, getFilterCount, removeChangeListener, removeFilter
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
test
public TLcyCompositeAndFilter()
TLcyCompositeAndFilter
, having no associated
ILcdFilter
s. It will therefore accept every object.@SafeVarargs public TLcyCompositeAndFilter(ILcdFilter<T>... aFilters)
TLcyCompositeAndFilter
populated with aFilters
.
The filter will only accept objects which are accepted by all filter instances.aFilters
- The initial filters to usepublic boolean accept(T aObject)
Returns true if all associated ILcdFilter
s accept the given Object
or if no ILcdFilter
s are associated. Returns false otherwise.
The filters are evaluated in order (see ALcyCompositeFilter.getFilter(int)
) and false
will
be returned as soon as the first filter is encountered which does not accept
aObject
(similar to the && construct of the Java language).
aObject
- The object to evaluate.ALcyCompositeFilter.addFilter(com.luciad.util.ILcdFilter)