| org.mandarax.kernel.meta.AbstractClauseSet org.mandarax.kernel.meta.JClauseSet
JClauseSet | final public class JClauseSet extends org.mandarax.kernel.meta.AbstractClauseSet implements ClauseSet(Code) | | Clause set use the java object model to build a fact base.
A JClauseSet has a method and an array of parameters.
A call to clauses() loops over all combinations of
elements in the object collections and invokes the method for any combination
of elements. The method is supposed to return a boolean. In case this
boolean is true, a fact is built with the method (wrapped by an instance of JPredicate )
as predicate and the respective set of objects (wrapped by constant terms).
After creating the object a couple of checks is performed, e.g. regarding the arity
of the array, whether the return type of the method is a boolean and whether the
method is public and therefore accessible.
If something is wrong, an exception is thrown. However, we do not check
whether all objects in the collections can be casted to the types expected by the method
at the respective positions. In this case, the exceptions thrown in invoke()
are captured, a message is printed out to System.err() and we coninue without
adding the fact.
author: Jens Dietrich version: 3.4 <7 March 05> since: 1.0 |
buildFacts | protected Collection buildFacts()(Code) | | Build the collection of facts.
java.util.Collection |
|
|