net.sf.molae.pipe.filter
Class KeyFilter

java.lang.Object
  |
  +--net.sf.molae.pipe.basic.ObjectProxy
        |
        +--net.sf.molae.pipe.filter.KeyFilter
All Implemented Interfaces:
Predicate

public final class KeyFilter
extends ObjectProxy
implements Predicate

Applies the given filter to the key of map entries.

See Also:
KeyFilteredMap

Constructor Summary
KeyFilter(Predicate filter)
          Constructs a KeyFilter object.
 
Method Summary
 boolean evaluate(Object 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(Predicate 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(Object input)
Applies the underlying filter to the key of the specified map entry.
Specified by:
evaluate in interface Predicate
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.