Package com.luciad.lucy.util
Class ALcyCompositeFilter<T>
java.lang.Object
com.luciad.lucy.util.ALcyCompositeFilter<T>
- All Implemented Interfaces:
ILcdChangeSource,ILcdDynamicFilter<T>,ILcdFilter<T>,Serializable,Predicate<T>
- Direct Known Subclasses:
TLcyCompositeAndFilter
Abstract implementation of a composite filter according to composite design
pattern. The exact behavior of how the added filters are combined, is left up
to the sub-classes.
Holds a collection of non null ILcdFilter instances.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a newALcyCompositeFilter, having no associatedILcdFilters. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddChangeListener(ILcdChangeListener aListener) Registers the given listener so it will receive change events from this source.voidaddFilter(ILcdFilter<T> aFilter) Adds the given filter to this composite filter.protected voidIndicates this filter has changed.getFilter(int aIndex) Returns the filter at the given index.intReturns the amount ifILcdFilters currently associated.voidremoveChangeListener(ILcdChangeListener aListener) Removes the specified listener so it is no longer notified.voidremoveFilter(ILcdFilter<T> aFilter) Removes the given filter from this composite filter.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.luciad.util.ILcdFilter
accept, test
-
Constructor Details
-
ALcyCompositeFilter
public ALcyCompositeFilter()Constructs a newALcyCompositeFilter, having no associatedILcdFilters.
-
-
Method Details
-
addFilter
Adds the given filter to this composite filter.- Parameters:
aFilter- The filter to add. Must be different from null.- See Also:
-
removeFilter
Removes the given filter from this composite filter. Does nothing if the givenILcdFilteris not associated to this composite filter.- Parameters:
aFilter- The filter to remove.- See Also:
-
getFilterCount
public int getFilterCount()Returns the amount ifILcdFilters currently associated.- Returns:
- the amount if
ILcdFilters currently associated. - See Also:
-
getFilter
Returns the filter at the given index.- Parameters:
aIndex- The index to retrieve theILcdFilterat.0 <= aIndex <= getFilterCount()- Returns:
- the filter at the given index.
- See Also:
-
addChangeListener
Description copied from interface:ILcdChangeSourceRegisters the given listener so it will receive change events from this source.
In case you need to register a listener which keeps a reference to an object with a shorter life-time than this change source, you can use a
ALcdWeakChangeListenerinstance as change listener.- Specified by:
addChangeListenerin interfaceILcdChangeSource- Parameters:
aListener- The listener to be notified when a change has happened.- See Also:
-
removeChangeListener
Description copied from interface:ILcdChangeSourceRemoves the specified listener so it is no longer notified.- Specified by:
removeChangeListenerin interfaceILcdChangeSource- Parameters:
aListener- The listener to remove.
-
fireChangeEvent
protected void fireChangeEvent()Indicates this filter has changed.
Extensions of this class should not call this method when a filter is added or removed. In such cases a change event is already fired.
When a filter which is added implements
ILcdChangeSourcethis class will already fire a change event when the added filter indicates it is changed. In such cases, it is not needed to call this method from the subclass.
-