ABLE 2.0.0 07/02/2003 10:25:01

com.ibm.able.rules
Class AbleWorkingMemoryLib

java.lang.Object
  |
  +--com.ibm.able.rules.AbleWorkingMemoryLib
All Implemented Interfaces:
java.io.Serializable

public class AbleWorkingMemoryLib
extends java.lang.Object
implements java.io.Serializable

This class provides a set of user-defined functions for manipulating an AbleWorkingMemory object in an AbleRuleSet.

See Also:
AbleWorkingMemory, AbleRuleSet, Serialized Form

Constructor Summary
AbleWorkingMemoryLib()
           
 
Method Summary
 void assert(AbleWorkingMemory wm, java.lang.Object fact)
          Place a fact into the database
 void assertAll(AbleWorkingMemory wm, java.util.List theList)
          Assert all elements in the list into working memory.
 void clear(AbleWorkingMemory wm)
          Clear all facts from the working memory
static java.lang.String Copyright()
          Determine the copyright of this class.
 boolean exists(AbleWorkingMemory wm, java.lang.Object fact)
          Test if the specified object exists in the working memory
 java.lang.Object find(AbleWorkingMemory wm, AbleSelector query)
          Find the first fact to match the query
 java.util.AbstractCollection findAll(AbleWorkingMemory wm, AbleSelector query)
          Find all facts that match the query
 java.util.AbstractCollection findAllInstances(AbleWorkingMemory wm, java.lang.String className)
          Find all objects that match the class
 void modify(AbleWorkingMemory wm, java.lang.Object fact)
          Modify or change an existing fact in the working memory
 void retract(AbleWorkingMemory wm, java.lang.Object fact)
          Remove a fact from the database
 void retractAll(AbleWorkingMemory wm, java.util.List theList)
          Retract all elements in the list from working memory.
 java.lang.String showWorkingMemory(AbleWorkingMemory wm)
          Returns a formatted string of the contents of the working memory to use for debugging.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbleWorkingMemoryLib

public AbleWorkingMemoryLib()
Method Detail

assert

public void assert(AbleWorkingMemory wm,
                   java.lang.Object fact)
Place a fact into the database
Parameters:
wm - The Working Memory.
fact - The Object to be asserted

assertAll

public void assertAll(AbleWorkingMemory wm,
                      java.util.List theList)
Assert all elements in the list into working memory. The list is unchanged.
Parameters:
wm - The Working Memory.
theList - The list from which elements are to be asserted.


retract

public void retract(AbleWorkingMemory wm,
                    java.lang.Object fact)
Remove a fact from the database
Parameters:
wm - The Working Memory.
fact - The Object to be removed

retractAll

public void retractAll(AbleWorkingMemory wm,
                       java.util.List theList)
Retract all elements in the list from working memory. The list is unchanged.
Parameters:
wm - The Working Memory.
theList - The list from which elements are to be retracted.


modify

public void modify(AbleWorkingMemory wm,
                   java.lang.Object fact)
Modify or change an existing fact in the working memory
Parameters:
wm - The Working Memory.
fact - The Object to be modified

clear

public void clear(AbleWorkingMemory wm)
Clear all facts from the working memory
Parameters:
wm - The Working Memory.

exists

public boolean exists(AbleWorkingMemory wm,
                      java.lang.Object fact)
Test if the specified object exists in the working memory
Parameters:
wm - The Working Memory.
fact - The object we are looking for in the working memory.

find

public java.lang.Object find(AbleWorkingMemory wm,
                             AbleSelector query)
                      throws AbleDataException
Find the first fact to match the query
Parameters:
wm - The Working Memory.
query - The AbleSelector used to query the working memory
Returns:
The first instance found

findAll

public java.util.AbstractCollection findAll(AbleWorkingMemory wm,
                                            AbleSelector query)
                                     throws AbleDataException
Find all facts that match the query

findAllInstances

public java.util.AbstractCollection findAllInstances(AbleWorkingMemory wm,
                                                     java.lang.String className)
                                              throws AbleDataException
Find all objects that match the class
Parameters:
wm - The Working Memory.
className - The name of the Java class instances to be found
Returns:
the matching instances (if any)

showWorkingMemory

public java.lang.String showWorkingMemory(AbleWorkingMemory wm)
Returns a formatted string of the contents of the working memory to use for debugging.

Copyright

public static java.lang.String Copyright()
Determine the copyright of this class.
Returns:
A String containing this class's copyright statement.

ABLE 2.0.0 07/02/2003 10:25:01

(C) Copyright IBM Corporation 1999, 2003