01: /*
02: * Copyright (C) 1999-2004 <A href="http://www-ist.massey.ac.nz/JBDietrich" target="_top">Jens Dietrich</a>
03: *
04: * This library is free software; you can redistribute it and/or
05: * modify it under the terms of the GNU Lesser General Public
06: * License as published by the Free Software Foundation; either
07: * version 2 of the License, or (at your option) any later version.
08: *
09: * This library is distributed in the hope that it will be useful,
10: * but WITHOUT ANY WARRANTY; without even the implied warranty of
11: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12: * Lesser General Public License for more details.
13: *
14: * You should have received a copy of the GNU Lesser General Public
15: * License along with this library; if not, write to the Free Software
16: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17: */
18: package org.mandarax.kernel;
19:
20: import java.util.Iterator;
21:
22: /**
23: * Set of clauses. Clause sets should be used to pack related clauses (e.g. facts
24: * with the same predicate or rules with the same predicates in the head). When the
25: * method <code>clauses()</code> is called to retrieve the
26: * element of the "set" (better: collection), then the set is actually be built.
27: * Therefore, clause sets can be <em>descriptive</em> containers. A typical application
28: * is the on the fly integration of facts from relational databases.
29: * Note that clauses (and thereby facts and rules) itself are treated as clause sets and
30: * therefore clause sets are often invisible to the user.
31: * Clause sets are the main entities managed by knowledge bases.
32: * @see org.mandarax.kernel.KnowledgeBase
33: * @see org.mandarax.kernel.Rule
34: * @see org.mandarax.kernel.Fact
35: * @author <A href="http://www-ist.massey.ac.nz/JBDietrich" target="_top">Jens Dietrich</A>
36: * @version 3.4 <7 March 05>
37: * @since 1.0
38: */
39: public interface ClauseSet extends KnowledgeOwner, PropertiesSupport {
40:
41: /**
42: * Add a clause set listener.
43: * @param l the listener
44: */
45: void addClauseSetChangeListener(ClauseSetChangeListener l);
46:
47: /**
48: * Get a key for indexing. The knowledge base is supposed to
49: * contain only clauses having the same key object. This method
50: * returns this key object. Note that this behavior is not enforced!
51: * @see org.mandarax.kernel.Fact#getKey
52: * @see org.mandarax.kernel.Rule#getKey
53: * @return the key object
54: */
55: public Object getKey();
56:
57: /**
58: * Remove a clause set listener.
59: * @param l the listener
60: */
61: void removeClauseSetChangeListener(ClauseSetChangeListener l);
62:
63: /**
64: * Get an iterator iterating over the predicates contained in this clause set.
65: * @return an iterator
66: */
67: Iterator predicates();
68: }
|