net.sf.molae.logic.basic
Class AbstractSinglePredicate

java.lang.Object
  |
  +--net.sf.molae.logic.basic.AdaptablePredicate
        |
        +--net.sf.molae.logic.basic.AbstractSinglePredicate
All Implemented Interfaces:
GeneralPredicate, Predicate, SinglePredicate
Direct Known Subclasses:
SetBasedPredicate

public abstract class AbstractSinglePredicate
extends AdaptablePredicate
implements SinglePredicate

Skeletal implementation of the SinglePredicate interface. Only evaluate and isEmpty have to be implemented by inheriting classes.

Since:
1.1

Constructor Summary
protected AbstractSinglePredicate()
          Constructs a new AbstractSinglePredicate.
 
Method Summary
 GeneralPredicate copy()
          Creates and returns a copy of this object.
static SinglePredicate negate(SinglePredicate p)
          Returns a negation of the specified predicate.
 GeneralPredicate not()
          Returns the negation of this predicate.
 
Methods inherited from class net.sf.molae.logic.basic.AdaptablePredicate
and, andNot, getBasePredicate, getProxyFor, implies, or, setBasePredicate, xor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sf.molae.logic.basic.SinglePredicate
and, andNot, or, xor
 
Methods inherited from interface net.sf.molae.logic.basic.GeneralPredicate
equals, evaluate, implies, isEmpty
 

Constructor Detail

AbstractSinglePredicate

protected AbstractSinglePredicate()
Constructs a new AbstractSinglePredicate.
Method Detail

copy

public GeneralPredicate copy()
Creates and returns a copy of this object. This implementation returns this object, because it is expected to be immutable.
Specified by:
copy in interface GeneralPredicate
Returns:
a clone of this instance

negate

public static SinglePredicate negate(SinglePredicate p)
Returns a negation of the specified predicate. This method can be used by classes that do not inherit from this class.
Parameters:
p - the predicate to negate
Returns:
a negation of the specified predicate.
See Also:
Negation.negate(net.sf.molae.logic.basic.GeneralPredicate)

not

public GeneralPredicate not()
Returns the negation of this predicate. This implementation uses a SinglePredicate implementing extension of Negation.
Specified by:
not in interface SinglePredicate
Returns:
the negation of this predicate.