org.drools
Class WorkingMemory

java.lang.Object
  |
  +--org.drools.WorkingMemory
Direct Known Subclasses:
TransactionalWorkingMemory

public class WorkingMemory
extends java.lang.Object

A knowledge session for a RuleBase.

Author:
bob mcwhirter

Constructor Summary
protected WorkingMemory(RuleBase ruleBase)
          Construct a new working memory for a ruleBase.
 
Method Summary
 void assertObject(java.lang.Object object)
          Assert a new fact object into this working memory.
 Agenda getAgenda()
          Retrieve the rule-firing Agenda for this WorkingMemory.
 JoinMemory getJoinMemory(JoinNode node)
          Retrieve the JoinMemory for a particular JoinNode.
 RuleBase getRuleBase()
          Retrieve the RuleBase of this working memory.
 void modifyObject(java.lang.Object object)
          Modify a fact object in this working memory.
 void retractObject(java.lang.Object object)
          Retract a fact object from this working memory.
 java.lang.String toString()
          Produce a debug string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WorkingMemory

protected WorkingMemory(RuleBase ruleBase)
Construct a new working memory for a ruleBase.

Parameters:
ruleBase - The rule base with which this memory is associated.
Method Detail

getAgenda

public Agenda getAgenda()
Retrieve the rule-firing Agenda for this WorkingMemory.

Returns:
The Agenda.

getRuleBase

public RuleBase getRuleBase()
Retrieve the RuleBase of this working memory.

Returns:
The RuleBase.

assertObject

public void assertObject(java.lang.Object object)
                  throws AssertionException
Assert a new fact object into this working memory.

Parameters:
object - The object to assert.
Throws:
AssertionException - if an error occurs during assertion.

retractObject

public void retractObject(java.lang.Object object)
                   throws RetractionException
Retract a fact object from this working memory.

Parameters:
object - The object to retract.
Throws:
RetractionException - if an error occurs during retraction.

modifyObject

public void modifyObject(java.lang.Object object)
                  throws FactException
Modify a fact object in this working memory. With the exception of time-based nodes, modification of a fact object is semantically equivelent to retracting and re-asserting it.

Parameters:
object - The object to modify.
Throws:
FactException - if an error occurs during modification.

getJoinMemory

public JoinMemory getJoinMemory(JoinNode node)
Retrieve the JoinMemory for a particular JoinNode.

Parameters:
node - The JoinNode key.
Returns:
The node's memory.

toString

public java.lang.String toString()
Produce a debug string.

Overrides:
toString in class java.lang.Object
Returns:
A debug string.


Copyright © 2001-2003 The Werken Company. All Rights Reserved.