net.sf.molae.pipe.filter
Class KeyFilter<K>

java.lang.Object
  extended by net.sf.molae.pipe.basic.ObjectProxy<TypedPredicate<? super K>>
      extended by 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

Constructor Summary
KeyFilter(TypedPredicate<? super K> filter)
          Constructs a KeyFilter object.
 
Method Summary
 boolean evaluate(Map.Entry<K,?> input)
          Applies the underlying filter to the key of the specified map entry.
 
Methods inherited from class net.sf.molae.pipe.basic.ObjectProxy
assertNotNull, equals, getBase, hashCode, toString, toVerboseString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

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.
Method Detail

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.