| |
|
| java.lang.Object org.mandarax.kernel.AbstractPropertiesSupport org.mandarax.kernel.meta.AbstractClauseSet
All known Subclasses: org.mandarax.kernel.meta.JClauseSet, org.mandarax.kernel.meta.JSymmetricClauseSet,
AbstractClauseSet | abstract class AbstractClauseSet extends AbstractPropertiesSupport implements CachedClauseSet(Code) | | Abstract clause set based on the reflect mechanism. The idea is to consider java methods with a boolean
return type as predicates and to analyse objects in order to build facts for tupels of objects
where the invokation of the method with these obects as parameter yields true.
Note that there is a boolean property to enable a cache mechanism. If the cache is switched off
(the default), any call to clauses() builds a new clause iterator and therefore may
perform a new fetch operation. Otherwise the result
is stored and the clause set will not note further changes in the object model.
There is also a flag to negate the clause set. If this flag is false (the default), a fact
is built from the objects where invokation of the method (the JPredicate) returns true .
If the set is negated, then a fact is built from objects where the invokation returns false ;
author: Jens Dietrich version: 3.4 <7 March 05> since: 1.0 version: 3.4 <7 March 05> |
cacheEnabled | protected boolean cacheEnabled(Code) | | |
clauseSetChangeListener | protected transient Vector clauseSetChangeListener(Code) | | |
negated | protected boolean negated(Code) | | |
AbstractClauseSet | protected AbstractClauseSet()(Code) | | Constructor.
|
AbstractClauseSet | protected AbstractClauseSet(boolean isNegated)(Code) | | Constructor.
Parameters: isNegated - true if the set should be negated, false otherwise |
addClauseSetChangeListener | public void addClauseSetChangeListener(ClauseSetChangeListener l)(Code) | | Add a clause set listener.
Parameters: l - a listener |
buildFact | protected Clause buildFact(Object target, Object[] parameters)(Code) | | Build a fact.
a fact Parameters: target - the object receiving the metod call Parameters: parameters - the parameters of the method call |
buildFacts | abstract protected Collection buildFacts()(Code) | | Build the collection of facts.
a collection of facts |
clauses | public org.mandarax.util.ClauseIterator clauses(Clause query, Object additionalParameter)(Code) | | Get an iterator for clauses. The parameters are ignored and clauses() is called!
a clause iterator Parameters: query - the query clause Parameters: additionalParameter - an additional parameter |
fireClauseSetChangeEvent | protected void fireClauseSetChangeEvent(ClauseSetChangeEvent e)(Code) | | Fire a clause set change event
Parameters: e - an event |
getKey | public Object getKey()(Code) | | Get a key for indexing. Here this is the predicate shared by all clauses in the set.
the key object |
isCacheEnabled | public boolean isCacheEnabled()(Code) | | Indicates whether the cache is enabled.
true if the cache is enabled, false otherwise |
predicates | public Iterator predicates()(Code) | | Get an iterator iterating over the predicates contained in this clause set.
an iterator |
removeClauseSetChangeListener | public void removeClauseSetChangeListener(ClauseSetChangeListener l)(Code) | | Remove a clause set listener.
Parameters: l - a listener |
reset | public void reset()(Code) | | Reset the set. In particular, this includes cleaning the cache.
|
setCacheEnabled | public void setCacheEnabled(boolean flag)(Code) | | Enable / disable the cache property.
Parameters: flag - true if the cache should be enabled and false if the cache should be disabled |
toString | public String toString()(Code) | | Convert the object to a string.
the string representation of this object |
|
|
|