Package com.luciad.lucy.util
Class TLcyCompositeAndFilter<T>
java.lang.Object
com.luciad.lucy.util.ALcyCompositeFilter<T>
com.luciad.lucy.util.TLcyCompositeAndFilter<T>
- All Implemented Interfaces:
ILcdChangeSource
,ILcdDynamicFilter<T>
,ILcdFilter<T>
,Serializable
,Predicate<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.
- See Also:
-
Constructor Summary
ConstructorDescriptionConstructs a newTLcyCompositeAndFilter
, having no associatedILcdFilter
s.TLcyCompositeAndFilter
(ILcdFilter<T>... aFilters) Constructs a newTLcyCompositeAndFilter
populated withaFilters
. -
Method Summary
Methods inherited from class com.luciad.lucy.util.ALcyCompositeFilter
addChangeListener, addFilter, fireChangeEvent, getFilter, getFilterCount, removeChangeListener, removeFilter
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.luciad.util.ILcdFilter
test
-
Constructor Details
-
TLcyCompositeAndFilter
public TLcyCompositeAndFilter()Constructs a newTLcyCompositeAndFilter
, having no associatedILcdFilter
s. It will therefore accept every object. -
TLcyCompositeAndFilter
Constructs a newTLcyCompositeAndFilter
populated withaFilters
. The filter will only accept objects which are accepted by all filter instances.- Parameters:
aFilters
- The initial filters to use- Since:
- 2016.1
-
-
Method Details
-
accept
Returns true if all associated
ILcdFilter
s accept the givenObject
or if noILcdFilter
s are associated. Returns false otherwise.The filters are evaluated in order (see
ALcyCompositeFilter.getFilter(int)
) andfalse
will be returned as soon as the first filter is encountered which does not acceptaObject
(similar to the&&
construct of the Java language).- Parameters:
aObject
- The object to evaluate.- Returns:
- True if all filters accept the object.
- See Also:
-