public abstract class AbstractAgenda extends java.lang.Object implements IAgenda
| Modifier and Type | Field and Description |
|---|---|
protected java.util.List |
history
The history of executed activations (if enabled).
|
protected Activation |
last
The last activation.
|
protected java.util.List |
listeners
Agenda listeners (if any).
|
protected int |
state
The state.
|
| Constructor and Description |
|---|
AbstractAgenda()
Create a new fifo agenda.
|
| Modifier and Type | Method and Description |
|---|---|
abstract void |
addActivation(Activation act)
Add a new activation.
|
void |
addAgendaListener(IAgendaListener listener)
Add an agenda listener.
|
void |
fireRule()
Fire one activated rule.
|
abstract java.util.Collection |
getActivations()
Get the current activations.
|
java.util.List |
getHistory()
Get the history.
|
Activation |
getLastActivation()
The last activation.
|
abstract Activation |
getNextActivation()
Get the next activation.
|
int |
getState()
Get the state of the agenda.
|
abstract boolean |
isEmpty()
Test if the agenda is empty.
|
boolean |
isHistoryEnabled()
Get the history mode.
|
protected void |
notifyListeners()
Notify all listeners (if any).
|
abstract void |
removeActivation(Activation act)
Remove an activation
|
void |
removeAgendaListener(IAgendaListener listener)
Remove an agenda listener.
|
void |
setHistoryEnabled(boolean enabled)
Set the history mode.
|
abstract void |
setNextActivation(Activation next)
Set the next activation.
|
java.lang.String |
toString()
Get the string representation.
|
protected Activation last
protected java.util.List listeners
protected java.util.List history
protected int state
public AbstractAgenda()
state - The state.public void fireRule()
public abstract void addActivation(Activation act)
act - The activation.public abstract void removeActivation(Activation act)
act - The activation.public abstract java.util.Collection getActivations()
getActivations in interface IAgendapublic abstract boolean isEmpty()
public abstract Activation getNextActivation()
getNextActivation in interface IAgendapublic abstract void setNextActivation(Activation next)
setNextActivation in interface IAgendapublic int getState()
public Activation getLastActivation()
getLastActivation in interface IAgendapublic boolean isHistoryEnabled()
isHistoryEnabled in interface IAgendapublic void setHistoryEnabled(boolean enabled)
setHistoryEnabled in interface IAgendapublic java.util.List getHistory()
getHistory in interface IAgendapublic void addAgendaListener(IAgendaListener listener)
addAgendaListener in interface IAgendalistener - The listener.public void removeAgendaListener(IAgendaListener listener)
removeAgendaListener in interface IAgendalistener - The listener.protected void notifyListeners()
public java.lang.String toString()
toString in class java.lang.Object