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

public abstract class ALcyCompositeFilter<T> extends Object implements ILcdDynamicFilter<T>
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 Details

    • ALcyCompositeFilter

      public ALcyCompositeFilter()
      Constructs a new ALcyCompositeFilter, having no associated ILcdFilters.
  • Method Details

    • addFilter

      public void addFilter(ILcdFilter<T> aFilter)
      Adds the given filter to this composite filter.
      Parameters:
      aFilter - The filter to add. Must be different from null.
      See Also:
    • removeFilter

      public void removeFilter(ILcdFilter<T> aFilter)
      Removes the given filter from this composite filter. Does nothing if the given ILcdFilter is not associated to this composite filter.
      Parameters:
      aFilter - The filter to remove.
      See Also:
    • getFilterCount

      public int getFilterCount()
      Returns the amount if ILcdFilters currently associated.
      Returns:
      the amount if ILcdFilters currently associated.
      See Also:
    • getFilter

      public ILcdFilter<T> getFilter(int aIndex)
      Returns the filter at the given index.
      Parameters:
      aIndex - The index to retrieve the ILcdFilter at. 0 <= aIndex <= getFilterCount()
      Returns:
      the filter at the given index.
      See Also:
    • addChangeListener

      public void addChangeListener(ILcdChangeListener aListener)
      Description copied from interface: ILcdChangeSource

      Registers 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 ALcdWeakChangeListener instance as change listener.

      Specified by:
      addChangeListener in interface ILcdChangeSource
      Parameters:
      aListener - The listener to be notified when a change has happened.
      See Also:
    • removeChangeListener

      public void removeChangeListener(ILcdChangeListener aListener)
      Description copied from interface: ILcdChangeSource
      Removes the specified listener so it is no longer notified.
      Specified by:
      removeChangeListener in interface ILcdChangeSource
      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 ILcdChangeSource this 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.