Package org.projog.core.event
Class ProjogListeners
- java.lang.Object
-
- org.projog.core.event.ProjogListeners
-
public class ProjogListeners extends java.lang.ObjectControls the registering and notification of listeners of aKnowledgeBase.Each
KnowledgeBasehas a single uniqueProjogListenersinstance.- See Also:
KnowledgeBase.getProjogListeners()
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Set<ProjogListener>listeners
-
Constructor Summary
Constructors Constructor Description ProjogListeners()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddListener(ProjogListener listener)Adds a listener to the set of listeners.booleandeleteListener(ProjogListener listener)Deletes an observer from the set of observers of this objects internalObservable.voidnotifyCall(SpyPoints.SpyPointEvent event)Notify all listeners of a first attempt to evaluate a goal.voidnotifyExit(SpyPoints.SpyPointExitEvent event)Notify all listeners when an attempt to evaluate a goal succeeds.voidnotifyFail(SpyPoints.SpyPointEvent event)Notify all listeners when an attempt to evaluate a goal fails.voidnotifyInfo(java.lang.String message)Notify all listeners of a general information event.voidnotifyRedo(SpyPoints.SpyPointEvent event)Notify all listeners of an attempt to re-evaluate a goal.voidnotifyWarn(java.lang.String message)Notify all listeners of a warning.
-
-
-
Field Detail
-
listeners
private final java.util.Set<ProjogListener> listeners
-
-
Method Detail
-
addListener
public boolean addListener(ProjogListener listener)
Adds a listener to the set of listeners.- Parameters:
listener- a listener to be added- Returns:
- true if this instance did not already reference the specified listener
-
deleteListener
public boolean deleteListener(ProjogListener listener)
Deletes an observer from the set of observers of this objects internalObservable.- Parameters:
listener- a listener to be deleted- Returns:
- true if this instance did reference the specified listener
-
notifyCall
public void notifyCall(SpyPoints.SpyPointEvent event)
Notify all listeners of a first attempt to evaluate a goal.
-
notifyRedo
public void notifyRedo(SpyPoints.SpyPointEvent event)
Notify all listeners of an attempt to re-evaluate a goal.
-
notifyExit
public void notifyExit(SpyPoints.SpyPointExitEvent event)
Notify all listeners when an attempt to evaluate a goal succeeds.
-
notifyFail
public void notifyFail(SpyPoints.SpyPointEvent event)
Notify all listeners when an attempt to evaluate a goal fails.
-
notifyWarn
public void notifyWarn(java.lang.String message)
Notify all listeners of a warning.
-
notifyInfo
public void notifyInfo(java.lang.String message)
Notify all listeners of a general information event.
-
-