se.lth.cs.nlp.nlputils.core
Class Predicate<T>

java.lang.Object
  extended by se.lth.cs.nlp.nlputils.core.Predicate<T>

public abstract class Predicate<T>
extends Object

A callable one-argument predicate.

Author:
Richard Johansson (richard@cs.lth.se)

Field Summary
static Predicate FALSE
          A predicate that always returns false.
protected  Object in
          Initiation parameter.
static Predicate TRUE
          A predicate that always returns true.
 
Constructor Summary
Predicate()
          Initiates the predicate.
Predicate(Object in)
          Initiates the predicate with a parameter.
 
Method Summary
abstract  boolean apply(T o)
          Calls this predicate.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TRUE

public static final Predicate TRUE
A predicate that always returns true.


FALSE

public static final Predicate FALSE
A predicate that always returns false.


in

protected Object in
Initiation parameter.

Constructor Detail

Predicate

public Predicate()
Initiates the predicate.


Predicate

public Predicate(Object in)
Initiates the predicate with a parameter.

Parameters:
in - an initiation parameter.
Method Detail

apply

public abstract boolean apply(T o)
Calls this predicate.

Parameters:
o - the object to test.
Returns:
the value of the predicate on the object o.