bibliothek.util.filter
Class PresetFilter<T>
java.lang.Object
bibliothek.util.filter.PresetFilter<T>
- Type Parameters:
T
- the kind of item this filter handles
- All Implemented Interfaces:
- Filter<T>
public class PresetFilter<T>
- extends Object
- implements Filter<T>
This filter keeps a set of items, an item is included if it is contained in that set.
- Author:
- Benjamin Sigg
Constructor Summary |
PresetFilter(T... items)
Creates a new filter |
Method Summary |
boolean |
includes(T item)
Tells whether the item item should be included or not. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PresetFilter
public PresetFilter(T... items)
- Creates a new filter
- Parameters:
items
- all the items to include
includes
public boolean includes(T item)
- Description copied from interface:
Filter
- Tells whether the item
item
should be included or not.
- Specified by:
includes
in interface Filter<T>
- Parameters:
item
- the item to include, depending on the user of this filter the item may or may not be null
- Returns:
true
if item
is included, false
if item
is excluded