Package jadex.rules.rulesystem.rete
Class RetePatternMatcherState
- java.lang.Object
-
- jadex.rules.rulesystem.rete.RetePatternMatcherState
-
- All Implemented Interfaces:
IPatternMatcherState,IOAVStateListener
public class RetePatternMatcherState extends java.lang.Object implements IPatternMatcherState, IOAVStateListener
The state specific part of a Rete pattern matcher.
-
-
Field Summary
Fields Modifier and Type Field Description protected AbstractAgendaagendaThe agenda.protected ReteNodenodeThe rete node.protected ReteMemoryretememThe rete memory.protected IOAVStatestateThe state.
-
Constructor Summary
Constructors Constructor Description RetePatternMatcherState(ReteNode node, IOAVState state, ReteMemory retemem, AbstractAgenda agenda)Create a state specific part of a Rete pattern matcher.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IAgendagetAgenda()Get the agenda.ReteMemorygetReteMemory()Get the Rete memory.ReteNodegetReteNode()Get the node.voidinit()Initialize the pattern matcher.voidobjectAdded(java.lang.Object id, OAVObjectType type, boolean root)Notification when an object has been added to the state.voidobjectModified(java.lang.Object id, OAVObjectType type, OAVAttributeType attr, java.lang.Object oldvalue, java.lang.Object newvalue)Notification when an attribute value of an object has been set.voidobjectRemoved(java.lang.Object id, OAVObjectType type)Notification when an object has been removed from state.
-
-
-
Field Detail
-
node
protected ReteNode node
The rete node.
-
retemem
protected ReteMemory retemem
The rete memory.
-
state
protected IOAVState state
The state.
-
agenda
protected AbstractAgenda agenda
The agenda.
-
-
Constructor Detail
-
RetePatternMatcherState
public RetePatternMatcherState(ReteNode node, IOAVState state, ReteMemory retemem, AbstractAgenda agenda)
Create a state specific part of a Rete pattern matcher.
-
-
Method Detail
-
init
public void init()
Initialize the pattern matcher. Called before the agenda is accessed to perform any initialization, if necessary.- Specified by:
initin interfaceIPatternMatcherState
-
getAgenda
public IAgenda getAgenda()
Get the agenda. The agenda can only be accessed, after the rule system has been initialized withinit().- Specified by:
getAgendain interfaceIPatternMatcherState- Returns:
- The agenda.
-
objectModified
public void objectModified(java.lang.Object id, OAVObjectType type, OAVAttributeType attr, java.lang.Object oldvalue, java.lang.Object newvalue)Notification when an attribute value of an object has been set.- Specified by:
objectModifiedin interfaceIOAVStateListener- Parameters:
id- The object id.type- The object type.attr- The attribute type.oldvalue- The oldvalue.newvalue- The newvalue.
-
objectAdded
public void objectAdded(java.lang.Object id, OAVObjectType type, boolean root)Notification when an object has been added to the state.- Specified by:
objectAddedin interfaceIOAVStateListener- Parameters:
id- The object id.type- The object type.root- Flag indicating that the object is a root object.
-
objectRemoved
public void objectRemoved(java.lang.Object id, OAVObjectType type)Notification when an object has been removed from state.- Specified by:
objectRemovedin interfaceIOAVStateListener- Parameters:
id- The object id.type- The object type.
-
getReteMemory
public ReteMemory getReteMemory()
Get the Rete memory.
-
getReteNode
public ReteNode getReteNode()
Get the node.- Returns:
- The node.
-
-