net.sf.molae.pipe.filter
Class KeyFilter<K>
java.lang.Object
net.sf.molae.pipe.basic.ObjectProxy<TypedPredicate<? super K>>
net.sf.molae.pipe.filter.KeyFilter<K>
- All Implemented Interfaces:
- TypedPredicate<Map.Entry<K,?>>
public final class KeyFilter<K>
- extends ObjectProxy<TypedPredicate<? super K>>
- implements TypedPredicate<Map.Entry<K,?>>
Applies the given filter to the key of map entries.
- See Also:
KeyFilteredMap
Method Summary |
boolean |
evaluate(Map.Entry<K,?> input)
Applies the underlying filter to the key of the specified map entry. |
KeyFilter
public KeyFilter(TypedPredicate<? super K> filter)
- Constructs a KeyFilter object.
- Parameters:
filter
- The filter to apply to the keys.
- Throws:
NullPointerException
- if the specified object is
null
.
evaluate
public boolean evaluate(Map.Entry<K,?> input)
- Applies the underlying filter to the key of the specified map entry.
- Specified by:
evaluate
in interface TypedPredicate<Map.Entry<K,?>>
- Parameters:
input
- the map entry to evaluate.
- Returns:
true
, iff the specified object is a
Map.Entry
and its key fulfils the condition of the
filter associated with this object.