Class TLcyModelObjectFilter

java.lang.Object
com.luciad.lucy.util.TLcyModelObjectFilter
All Implemented Interfaces:
ILcdChangeSource, ILcdDynamicFilter, ILcdFilter, Serializable, Predicate

public class TLcyModelObjectFilter extends Object implements ILcdDynamicFilter

An implementation of ILcdFilter that is able to filter out specific objects of an ILcdIntegerIndexed. The set of accepted objects can be changed using changeFilter(Object, boolean) or changeFilterAllObjects(boolean).

This filter is used by default by the table view. Setting such a filter on your layer will allow the TableView to directly adjust your filter.

Since:
11.0
See Also:
  • Constructor Details

    • TLcyModelObjectFilter

      public TLcyModelObjectFilter(ILcdIntegerIndexedModel aModel)
      Create a new filter
      Parameters:
      aModel - The model of aLayer. Must be an ILcdIntegerIndexedModel
  • Method Details

    • addChangeListener

      public void addChangeListener(ILcdChangeListener aChangeListener)
      Adds the given ILcdChangeListener. This listener is informed whenever this ILcdFilter has changed. That is, when the accept method returns a different value for at least one of the objects of the associated ILcdIntegerIndexedModel.
      Specified by:
      addChangeListener in interface ILcdChangeSource
      Parameters:
      aChangeListener - The listener to add.
      See Also:
    • removeChangeListener

      public void removeChangeListener(ILcdChangeListener aChangeListener)
      Removes the given ILcdChangeListener
      Specified by:
      removeChangeListener in interface ILcdChangeSource
      Parameters:
      aChangeListener - The listener to remove.
    • fireChangeEvent

      protected void fireChangeEvent(TLcdChangeEvent aEvent)
      Fires the given TLcdChangeEvent to all listeners.
      Parameters:
      aEvent - The event to fire.
    • getModel

      public ILcdIntegerIndexedModel getModel()
      Returns the associated ILcdIntegerIndexedModel for which this ILcdFilter works.
      Returns:
      the associated ILcdIntegerIndexedModel for which this ILcdFilter works.
    • setModel

      public void setModel(ILcdIntegerIndexedModel aModel)
      Sets the ILcdIntegerIndexedModel for which this ILcdFilter works.
      Parameters:
      aModel - The model for which this filter will work.
    • changeFilter

      public void changeFilter(Object aObject, boolean aAccept)
      Sets whether or not an object should be accepted (e.g., visible) by this ILcdFilter.
      Parameters:
      aObject - The object of which to change the accepted state, must be an element of the associated ILcdIntegerIndexedModel.
      aAccept - true if the object should be accepted, false otherwise.
      See Also:
    • changeFilter

      public void changeFilter(List<Object> aObjectList, boolean aAccept)
      Sets whether or not an object/multiple objects should be accepted (e.g., visible) by this ILcdFilter
      Parameters:
      aObjectList - A List of objects of which to change the accepted state. Every Object in the list must be an element of the associated ILcdIntegerIndexedModel.
      aAccept - true if each of the Objects in aObjectList must be accepted, false otherwise
      See Also:
    • changeFilterAllObjects

      public void changeFilterAllObjects(boolean aAccept)
      Changes the accepted state (e.g., the visibility) of all the objects in the ILcdModel.
      Parameters:
      aAccept - true if all model objects should be accepted, false otherwise.
    • accept

      public boolean accept(Object aObject)
      Description copied from interface: ILcdFilter
      Tests if a given object passes the filter or not. The actual test condition is specified by the implementation of this interface.
      Specified by:
      accept in interface ILcdFilter
      Parameters:
      aObject - the object to be tested by the filter.
      Returns:
      true if the object passes the filter, false otherwise.
    • getNumberOfAcceptedObjects

      public int getNumberOfAcceptedObjects()
      Returns the number of domain objects that are accepted by this filter.
      Returns:
      The number of accepted domain objects. Is always between 0 and getModel().size().