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
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractSinglePredicate
protected AbstractSinglePredicate()
- Constructs a new AbstractSinglePredicate.
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.