ABLE 2.3.0 07/13/2005 14:21:00

com.ibm.able.rules
Interface AbleWorkingMemory

All Known Implementing Classes:
AbleObjectWorkingMemory, AblePatternMatchNetwork, AblePredicateWorkingMemory

public interface AbleWorkingMemory

This class defines an interface which the behavior of a working memory used by one of the AbleInferenceEngines as part of an AbleRuleSet.

See Also:
AbleInferenceEngine, AbleRuleSet

Method Summary
 boolean asserta(java.lang.Object fact)
          Place a fact into the working memory at front.
 void assertAll(java.util.List theList)
          Assert all elements in the list into working memory.
 boolean assertFact(java.lang.Object fact)
          Place a fact into the working memory.
 boolean assertz(java.lang.Object fact)
          Place a fact into the database at end.
 void clear()
          Remove all objects stored in this working memory
 boolean exists(java.lang.Object fact)
          Test if the specified object exists in the working memory
 java.lang.Object find(AbleSelector query)
          Find the first fact to match the query
 java.util.AbstractCollection findAll(AbleSelector query)
          Find all facts that match the query
 java.util.AbstractCollection findAllInstances(java.lang.String className)
          Find all objects that match the class
 java.util.Enumeration getClasses()
          Retrieve all classes stored in this working memory
 boolean isEmpty()
          Returns true if the working memory is empty (contains no objects)
 void modify(java.lang.Object fact)
          Modify or change an existing fact in the database
 void modifyFact(java.lang.Object fact)
          Modify or change an existing fact in the database
 void retract(java.lang.Object fact)
          Remove a fact from the database
 void retractAll(java.util.List theList)
          Retract all elements in the list from working memory.
 void retractFact(java.lang.Object fact)
          Remove a fact from the database
 java.lang.Object[] toArray()
          Format the contents of working memory as an array of String[] Able array variables Note: this is an expensive operation
 

Method Detail

assertFact

public boolean assertFact(java.lang.Object fact)
Place a fact into the working memory. Return true if a new fact.


asserta

public boolean asserta(java.lang.Object fact)
Place a fact into the working memory at front. Return true if a new fact.


assertz

public boolean assertz(java.lang.Object fact)
Place a fact into the database at end. Return true if a new fact.


assertAll

public void assertAll(java.util.List theList)
Assert all elements in the list into working memory. The list is unchanged.

Parameters:
theList - The list from which elements are to be asserted.


retract

public void retract(java.lang.Object fact)
Remove a fact from the database


retractFact

public void retractFact(java.lang.Object fact)
Remove a fact from the database


retractAll

public void retractAll(java.util.List theList)
Retract all elements in the list from working memory. The list is unchanged.

Parameters:
theList - The list from which elements are to be retracted.


modify

public void modify(java.lang.Object fact)
Modify or change an existing fact in the database


modifyFact

public void modifyFact(java.lang.Object fact)
Modify or change an existing fact in the database


exists

public boolean exists(java.lang.Object fact)
Test if the specified object exists in the working memory

Parameters:
fact - The object we are looking for in the working memory.
Returns:
true if the object was found, false otherwise

find

public java.lang.Object find(AbleSelector query)
                      throws AbleDataException
Find the first fact to match the query

Throws:
AbleDataException

findAll

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

Throws:
AbleDataException

findAllInstances

public java.util.AbstractCollection findAllInstances(java.lang.String className)
Find all objects that match the class


getClasses

public java.util.Enumeration getClasses()
Retrieve all classes stored in this working memory


clear

public void clear()
Remove all objects stored in this working memory


isEmpty

public boolean isEmpty()
Returns true if the working memory is empty (contains no objects)


toArray

public java.lang.Object[] toArray()
                           throws AbleDataException
Format the contents of working memory as an array of String[] Able array variables Note: this is an expensive operation

Throws:
AbleDataException

ABLE 2.3.0 07/13/2005 14:21:00

(C) Copyright IBM Corporation 1999, 2005