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 AbstractAgenda
agenda
The agenda.protected ReteNode
node
The rete node.protected ReteMemory
retemem
The rete memory.protected IOAVState
state
The 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 IAgenda
getAgenda()
Get the agenda.ReteMemory
getReteMemory()
Get the Rete memory.ReteNode
getReteNode()
Get the node.void
init()
Initialize the pattern matcher.void
objectAdded(java.lang.Object id, OAVObjectType type, boolean root)
Notification when an object has been added to the state.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.void
objectRemoved(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:
init
in interfaceIPatternMatcherState
-
getAgenda
public IAgenda getAgenda()
Get the agenda. The agenda can only be accessed, after the rule system has been initialized withinit()
.- Specified by:
getAgenda
in 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:
objectModified
in 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:
objectAdded
in 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:
objectRemoved
in 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.
-
-