org.drools.reteoo.impl
Class ReteImpl

java.lang.Object
  |
  +--org.drools.reteoo.impl.ReteImpl
All Implemented Interfaces:
Rete

public class ReteImpl
extends java.lang.Object
implements Rete

The Rete-OO network. This node accepts an Object, and simply propagates it to all ObjectTypeNodes for type testings.

Author:
bob mcwhirter
See Also:
ObjectTypeNodeImpl

Constructor Summary
ReteImpl()
          Construct.
 
Method Summary
 void assertObject(java.lang.Object object, WorkingMemory workingMemory)
          Assert a new fact object into this RuleBase and the specified WorkingMemory.
 ObjectTypeNode getObjectTypeNode(ObjectType objectType)
          Retrieve an ObjectTypeNode keyed by ObjectType.
 java.util.Collection getObjectTypeNodes()
          Retrieve all ObjectTypeNode children of this node.
 ObjectTypeNodeImpl getOrCreateObjectTypeNode(ObjectType objectType)
          Retrieve an ObjectTypeNode keyed by ObjectType, creating one, if necessary.
 void modifyObject(java.lang.Object object, WorkingMemory workingMemory)
          Modify a fact object in this RuleBase and the specified WorkingMemory.
 void retractObject(java.lang.Object object, WorkingMemory workingMemory)
          Retract a fact object from this RuleBase and the specified WorkingMemory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReteImpl

public ReteImpl()
Construct.
Method Detail

assertObject

public void assertObject(java.lang.Object object,
                         WorkingMemory workingMemory)
                  throws AssertionException
Assert a new fact object into this RuleBase and the specified WorkingMemory.
Specified by:
assertObject in interface Rete
Parameters:
object - The object to assert.
workingMemory - The working memory session.
Throws:
AssertionException - if an error occurs during assertion.

retractObject

public void retractObject(java.lang.Object object,
                          WorkingMemory workingMemory)
                   throws RetractionException
Retract a fact object from this RuleBase and the specified WorkingMemory.
Specified by:
retractObject in interface Rete
Parameters:
object - The object to retract.
workingMemory - The working memory session.
Throws:
RetractionException - if an error occurs during retraction.

modifyObject

public void modifyObject(java.lang.Object object,
                         WorkingMemory workingMemory)
                  throws FactException
Modify a fact object in this RuleBase and the specified WorkingMemory. With the exception of time-based nodes, modification of a fact object is semantically equivelent to retracting and re-asserting it.
Specified by:
modifyObject in interface Rete
Parameters:
object - The object to modify.
workingMemory - The working memory session.
Throws:
FactException - if an error occurs during modification.

getObjectTypeNodes

public java.util.Collection getObjectTypeNodes()
Retrieve all ObjectTypeNode children of this node.
Returns:
The Set of ObjectTypeNodes.

getObjectTypeNode

public ObjectTypeNode getObjectTypeNode(ObjectType objectType)
Retrieve an ObjectTypeNode keyed by ObjectType.
Parameters:
objectType - The ObjectType key.
Returns:
The matching ObjectTypeNode if one has already been created, else null.

getOrCreateObjectTypeNode

public ObjectTypeNodeImpl getOrCreateObjectTypeNode(ObjectType objectType)
Retrieve an ObjectTypeNode keyed by ObjectType, creating one, if necessary.
Parameters:
objectType - The ObjectType key.
Returns:
The matching ObjectTypeNode.


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