Package com.macrofocus.filter
Class SimpleFilter<E>
- java.lang.Object
-
- com.macrofocus.filter.AbstractFilter<E>
-
- com.macrofocus.filter.AbstractMutableFilter<E>
-
- com.macrofocus.filter.SimpleFilter<E>
-
- All Implemented Interfaces:
Filter<E>
,MutableFilter<E>
public final class SimpleFilter<E> extends AbstractMutableFilter<E>
A simple mutable filter implementation.
-
-
Constructor Summary
Constructors Constructor Description SimpleFilter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearFilter()
void
clearFilter(java.lang.Object locksmith)
int
getFilteredCount()
Returns the number of elements currently filtered.boolean
isActive()
Indicates whether at least one element is currently filtered.boolean
isFiltered(E element)
Indicates whether a given element is filtered or not.boolean
isFiltered(E element, java.lang.Object locksmith)
Indicates whether a given element is filtered or not by the given locksmith.java.util.Iterator<E>
iterator()
void
setFiltered(E element, boolean filtered, java.lang.Object locksmith)
void
setFiltered(java.lang.Iterable<E> elements, boolean filtered, java.lang.Object locksmith)
void
setFiltered(java.lang.Iterable<E> filtered, java.lang.Iterable<E> unfiltered, java.lang.Object locksmith)
-
Methods inherited from class com.macrofocus.filter.AbstractMutableFilter
setEnabled
-
Methods inherited from class com.macrofocus.filter.AbstractFilter
addFilterListener, addWeakFilterListener, isEnabled, notifyFilteredChanged, removeFilterListener, removeFilterListeners
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.macrofocus.filter.Filter
addFilterListener, addWeakFilterListener, isEnabled, removeFilterListener, removeFilterListeners
-
-
-
-
Method Detail
-
isActive
public boolean isActive()
Description copied from interface:Filter
Indicates whether at least one element is currently filtered.- Returns:
- true if at least one element is filtered, false otherwise.
-
isFiltered
public boolean isFiltered(E element)
Description copied from interface:Filter
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
-
clearFilter
public void clearFilter()
-
clearFilter
public void clearFilter(java.lang.Object locksmith)
-
isFiltered
public boolean isFiltered(E element, java.lang.Object locksmith)
Description copied from interface:Filter
Indicates whether a given element is filtered or not by the given locksmith.- Parameters:
element
- the element to be testedlocksmith
- the object used to filter the element- Returns:
- true if the element is filtered, false otherwise
-
getFilteredCount
public int getFilteredCount()
Description copied from interface:Filter
Returns the number of elements currently filtered.- Returns:
- the number of filtered elements.
-
setFiltered
public void setFiltered(E element, boolean filtered, java.lang.Object locksmith)
-
setFiltered
public void setFiltered(java.lang.Iterable<E> elements, boolean filtered, java.lang.Object locksmith)
-
setFiltered
public void setFiltered(java.lang.Iterable<E> filtered, java.lang.Iterable<E> unfiltered, java.lang.Object locksmith)
-
iterator
public java.util.Iterator<E> iterator()
-
-