|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jscience.computing.ai.expertsystem.conflict.AbstractConflictSet
public abstract class AbstractConflictSet
This class provides a skeletal implementation of the ConflictSet
interface to minimize the effort required to implement this interface. It
helps mainly in dealing with the registered listeners for conflict set
events. Its subclasses must invoke the methods elementAdded
and elementRemoved wheneved applicable to make full use of the
notification mechanism this skeleton provides.
| Field Summary | |
|---|---|
protected boolean |
debug
Flag indicating whether there is some registered listener. |
protected java.util.Vector |
listeners
The event listeners. |
| Constructor Summary | |
|---|---|
AbstractConflictSet()
Class constructor. |
|
| Method Summary | |
|---|---|
void |
addInternalConflictSetListener(InternalConflictSetListener l)
Adds the specified listener to receive events from this conflict set. |
protected void |
elementAdded(ConflictSetElement e)
Callback method, used to indicate that an element has been added to this conflict set. |
protected void |
elementRemoved(ConflictSetElement e)
Callback method, used to indicate that an element has been removed from this conflict set. |
protected void |
removeElementsWith_1D(java.util.Vector fireableRules,
java.lang.Object obj)
Auxiliar method, used to remove the elements that use a given object in its instantiations. |
protected int |
removeElementsWith_2D(java.util.Vector fireableRules,
java.lang.Object obj)
Auxiliar method, used to remove the elements that use a given object in its instantiations. |
void |
removeInternalConflictSetListener(InternalConflictSetListener l)
Removes the specified listener so that it no longer receives events from this conflict set. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.jscience.computing.ai.expertsystem.conflict.ConflictSet |
|---|
flush, insertElement, isEmpty, nextElement, removeElementsWith |
| Field Detail |
|---|
protected java.util.Vector listeners
protected boolean debug
| Constructor Detail |
|---|
public AbstractConflictSet()
| Method Detail |
|---|
public void addInternalConflictSetListener(InternalConflictSetListener l)
addInternalConflictSetListener in interface ConflictSetl - the conflict set listenerprotected void elementAdded(ConflictSetElement e)
e - the element that has been added to this conflict set.protected void elementRemoved(ConflictSetElement e)
nextElement are not considered as been removed.
e - the element that has been removed from this conflict set.
protected void removeElementsWith_1D(java.util.Vector fireableRules,
java.lang.Object obj)
fireableRules - the Vector that stores the fireable rules.obj - the given object.
protected int removeElementsWith_2D(java.util.Vector fireableRules,
java.lang.Object obj)
fireableRules - the Vector that stores the fireable rules.obj - the given object.
public void removeInternalConflictSetListener(InternalConflictSetListener l)
removeInternalConflictSetListener in interface ConflictSetl - the conflict set listener
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||