|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--net.sf.molae.logic.basic.AdaptablePredicate
Provides a predicate with a proxy strategy. Every method that takes a predicate as an argument, checks if the argument predicate provides a proxy for this predicate. If not it is also checked if this predicate provides a proxy for the argument predicate (for symmetric methods only). If a proxy is found it is used, otherwise the call is delegated to the default (base) instance.
ProxyProvider| Constructor Summary | |
AdaptablePredicate()
|
|
| Method Summary | |
GeneralPredicate |
and(GeneralPredicate p)
Returns the conjunction of this predicate and the specified predicate. |
GeneralPredicate |
andNot(GeneralPredicate p)
Returns the difference of this predicate and the specified predicate. |
protected GeneralPredicate |
getBasePredicate()
Returns the base object as a GeneralPredicate. |
static GeneralPredicate |
getProxyFor(GeneralPredicate provider,
GeneralPredicate p)
Tries to get a proxy. |
boolean |
implies(GeneralPredicate p)
Tests if this predicate implies the specified predicate. |
GeneralPredicate |
or(GeneralPredicate p)
Returns the disjunction of this predicate and the specified predicate. |
protected void |
setBasePredicate(GeneralPredicate base)
Sets the base object to the specified value. |
GeneralPredicate |
xor(GeneralPredicate p)
Returns the exclusive disjunction of this predicate and the specified predicate. |
| 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.GeneralPredicate |
copy, equals, evaluate, isEmpty, not |
| Constructor Detail |
public AdaptablePredicate()
| Method Detail |
protected GeneralPredicate getBasePredicate()
GeneralPredicate.GeneralPredicate.setBasePredicate(net.sf.molae.logic.basic.GeneralPredicate)protected void setBasePredicate(GeneralPredicate base)
base - the default predicate, of which the methods are
called, if no proxy was found.IllegalArgumentException - base is thisgetBasePredicate()
public static GeneralPredicate getProxyFor(GeneralPredicate provider,
GeneralPredicate p)
provider - the ProxyProvider candidate.p - the predicate for which a proxy is requested.null, if no proxy was found.public boolean implies(GeneralPredicate p)
GeneralPredicateevaluate method of the specified
predicate returns true for every argument for
which the evaluate method of this predicate
returns true,
or more formally:
implies(p) ⇔ ( ∀x evaluate(x) ⇒ p.evaluate(x) )It is not required but recommended that the inversion also holds.
implies in interface GeneralPredicatenet.sf.molae.logic.basic.GeneralPredicatep - predicate to be checked for implication in this predicate.ClassCastException - if this method is not implemented for
the specified predicate.IllegalArgumentException - if this method is not implemented for
the specified predicate.NullPointerException - if p is null.public GeneralPredicate and(GeneralPredicate p)
GeneralPredicateevaluate method of the conjunction returns
true, iff the evaluate methods of both
(this and the specified predicate) return true.
This interface does not specify the state of this object after the operation has been performed. It can be changed or unchanged. Therefore this method should either be used with a subinterface that specifies the state of this object or all references to it should be discarded afterwards.
and in interface GeneralPredicatenet.sf.molae.logic.basic.GeneralPredicatep - predicate to be conjoined with this predicateClassCastException - if the conjunction of this predicate
and the specified predicate is not defined.IllegalArgumentException - if the conjunction of this predicate
and the specified predicate is not defined.NullPointerException - if p is null.public GeneralPredicate andNot(GeneralPredicate p)
GeneralPredicateevaluate method of the difference returns
true, iff the evaluate methods of this
predicate returns true and
the evaluate method of the specified predicate returns
false.
This interface does not specify the state of this object after the operation has been performed. It can be changed or unchanged. Therefore this method should either be used with a subinterface that specifies the state of this object or all references to it should be discarded afterwards.
andNot in interface GeneralPredicatenet.sf.molae.logic.basic.GeneralPredicatep - predicate to be conjoined with this predicateClassCastException - if the difference of this predicate
and the specified predicate is not defined.IllegalArgumentException - if the difference of this predicate
and the specified predicate is not defined.NullPointerException - if p is null.public GeneralPredicate or(GeneralPredicate p)
GeneralPredicateevaluate method of the disjunction returns
false, iff the evaluate methods of both
(this and the specified predicate) return false.
This interface does not specify the state of this object after the operation has been performed. It can be changed or unchanged. Therefore this method should either be used with a subinterface that specifies the state of this object or all references to it should be discarded afterwards.
or in interface GeneralPredicatenet.sf.molae.logic.basic.GeneralPredicatep - predicate to be conjoined with this predicateClassCastException - if the disjunction of this predicate
and the specified predicate is not defined.IllegalArgumentException - if the disjunction of this predicate
and the specified predicate is not defined.NullPointerException - if p is null.public GeneralPredicate xor(GeneralPredicate p)
GeneralPredicateevaluate method of the exclusive disjunction returns
true, iff the evaluate methods of one of
the predicates returns true and the
evaluate method of the other predicate returns
false.
This interface does not specify the state of this object after the operation has been performed. It can be changed or unchanged. Therefore this method should either be used with a subinterface that specifies the state of this object or all references to it should be discarded afterwards.
xor in interface GeneralPredicatenet.sf.molae.logic.basic.GeneralPredicatep - predicate to be conjoined with this predicateClassCastException - if the exclusive disjunction of this
predicate and the specified predicate is not defined.IllegalArgumentException - if the exclusive disjunction of this
predicate and the specified predicate is not defined.NullPointerException - if p is null.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||