Package com.macrofocus.filter

# Interface Filter<E>

Type Parameters:
  `E` - the type of elements that can be filtered

All Known Subinterfaces:
  `MutableFilter<E>`, `MutableIndexFilter<E>`

All Known Implementing Classes:
  `AbstractFilter`, `AbstractMutableFilter`, `AbstractMutableIndexFilter`, `SimpleFilter`, `SimpleIndexFilter`

@JsType public interface Filter<E>
This interface represents the current state of a filter. A filter is to be understood in the broad sense and not only related to user interactions.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addFilterListener(FilterListener<E> listener)`
  Add a listener to the list that's notified each time a change to the filter occurs.
  `void`
  `addWeakFilterListener(FilterListener<E> listener)`
  Add a listener to the list that's notified each time a change to the filter occurs.
  `int`
  `getFilteredCount()`
  Returns the number of elements currently filtered.
  `boolean`
  `isActive()`
  Indicates whether at least one element is currently filtered.
  `boolean`
  `isEnabled()`
  `boolean`
  `isFiltered(E element)`
  Indicates whether a given element is filtered or not.
  `boolean`
  `isFilteredBy(E element, Object locksmith)`
  Indicates whether a given element is filtered or not by the given locksmith.
  `void`
  `removeFilterListener(FilterListener<E> listener)`
  Remove a listener to the list that's notified each time a change to the filter occurs.
  `void`
  `removeFilterListeners()`
  Remove all listeners to the list that's notified each time a change to the selection occurs.

- ## Method Details

  - ### isActive

    boolean isActive()
    Indicates whether at least one element is currently filtered.
    Returns:
      true if at least one element is filtered, false otherwise.

  - ### isFiltered

    boolean isFiltered(E element)
    Indicates whether a given element is filtered or not.
    Parameters:
      `element` - the element to be tested
    Returns:
      true if the element is filtered, false otherwise

  - ### isFilteredBy

    boolean isFilteredBy(E element, Object locksmith)
    Indicates whether a given element is filtered or not by the given locksmith.
    Parameters:
      `element` - the element to be tested
      `locksmith` - the object used to filter the element
    Returns:
      true if the element is filtered, false otherwise

  - ### getFilteredCount

    int getFilteredCount()
    Returns the number of elements currently filtered.
    Returns:
      the number of filtered elements.

  - ### addFilterListener

    void addFilterListener(FilterListener<E> listener)
    Add a listener to the list that's notified each time a change to the filter occurs.
    Parameters:
      `listener` - the SelectionListener

  - ### addWeakFilterListener

    void addWeakFilterListener(FilterListener<E> listener)
    Add a listener to the list that's notified each time a change to the filter occurs. The listener will automatically be disposed of should no other object have a reference to it.
    Parameters:
      `listener` - the SelectionListener

  - ### removeFilterListener

    void removeFilterListener(FilterListener<E> listener)
    Remove a listener to the list that's notified each time a change to the filter occurs.
    Parameters:
      `listener` - the SelectionListener

  - ### removeFilterListeners

    void removeFilterListeners()
    Remove all listeners to the list that's notified each time a change to the selection occurs.

  - ### isEnabled

    boolean isEnabled()