Overview | Package | Class | Use | Tree | Serialized | Deprecated | Index | Help
| ABLE 2.3.0 07/13/2005 14:21:00
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.ibm.able.rules
Class AblePredicateWorkingMemory

    java.lang.Object
      com.ibm.able.rules.AblePredicateWorkingMemory

All Implemented Interfaces:
  AbleWorkingMemory, java.io.Serializable

public class AblePredicateWorkingMemory
extends java.lang.Object
implements AbleWorkingMemory, java.io.Serializable

This class holds instances of one or more Java classes and handles AblePredicates in a unique manner (keyed by name/arity) rather than just Class name.

See Also:
  Serialized Form

Constructor Summary
`AblePredicateWorkingMemory(AbleRuleSet theRuleSet)`

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)` Given a query which is a pattern match rule Return the first object that matches the constraints
`java.util.AbstractCollection` | `findAll(AbleSelector query)` Given a query which is a pattern match rule Return the all objects that match the constraints
`java.util.AbstractCollection` | `findAllInstances(java.lang.String key)` Find all objects that match the class name or predicate signature Return a cloned vector of references
`java.util.Vector` | `findAllRules(java.lang.String key)` Find all Rule predicates that match the predicate signature Return a cloned vector of references
`java.util.Enumeration` | `getClasses()` Retrieve all classes (types) or predicates 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
`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
`java.lang.String` | `toString()` Format the contents of working memory into a String For display in an Inspector

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### AblePredicateWorkingMemory

    public AblePredicateWorkingMemory(AbleRuleSet theRuleSet)

Method Detail

### assertFact

    public boolean assertFact(java.lang.Object fact)

  Description copied from interface: `AbleWorkingMemory`
  Place a fact into the working memory. Return true if a new fact.

  Specified by:
    `assertFact` in interface `AbleWorkingMemory`

### asserta

    public boolean asserta(java.lang.Object fact)

  Description copied from interface: `AbleWorkingMemory`
  Place a fact into the working memory at front. Return true if a new fact.

  Specified by:
    `asserta` in interface `AbleWorkingMemory`

### assertz

    public boolean assertz(java.lang.Object fact)

  Description copied from interface: `AbleWorkingMemory`
  Place a fact into the database at end. Return true if a new fact.

  Specified by:
    `assertz` in interface `AbleWorkingMemory`

### assertAll

    public void assertAll(java.util.List theList)

  Assert all elements in the list into working memory. The list is unchanged.

  Specified by:
    `assertAll` in interface `AbleWorkingMemory`
  Parameters:
    `theList` - The list from which elements are to be asserted.

### retractFact

    public void retractFact(java.lang.Object fact)

  Description copied from interface: `AbleWorkingMemory`
  Remove a fact from the database

  Specified by:
    `retractFact` in interface `AbleWorkingMemory`

### retract

    public void retract(java.lang.Object fact)

  Description copied from interface: `AbleWorkingMemory`
  Remove a fact from the database

  Specified by:
    `retract` in interface `AbleWorkingMemory`

### retractAll

    public void retractAll(java.util.List theList)

  Retract all elements in the list from working memory. The list is unchanged.

  Specified by:
    `retractAll` in interface `AbleWorkingMemory`
  Parameters:
    `theList` - The list from which elements are to be retracted.

### modifyFact

    public void modifyFact(java.lang.Object fact)

  Description copied from interface: `AbleWorkingMemory`
  Modify or change an existing fact in the database

  Specified by:
    `modifyFact` in interface `AbleWorkingMemory`

### modify

    public void modify(java.lang.Object fact)

  Modify or change an existing fact

  Specified by:
    `modify` in interface `AbleWorkingMemory`

### exists

    public boolean exists(java.lang.Object fact)

  Test if the specified object exists in the working memory.

  Specified by:
    `exists` in interface `AbleWorkingMemory`
  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

  Given a query which is a pattern match rule Return the first object that matches the constraints

  Specified by:
    `find` in interface `AbleWorkingMemory`
  Throws:
    `AbleDataException`

### findAll

    public java.util.AbstractCollection findAll(AbleSelector query)
                                         throws AbleDataException

  Given a query which is a pattern match rule Return the all objects that match the constraints

  Specified by:
    `findAll` in interface `AbleWorkingMemory`
  Throws:
    `AbleDataException`

### findAllInstances

    public java.util.AbstractCollection findAllInstances(java.lang.String key)

  Find all objects that match the class name or predicate signature Return a cloned vector of references

  Specified by:
    `findAllInstances` in interface `AbleWorkingMemory`

### findAllRules

    public java.util.Vector findAllRules(java.lang.String key)

  Find all Rule predicates that match the predicate signature Return a cloned vector of references

### getClasses

    public java.util.Enumeration getClasses()

  Retrieve all classes (types) or predicates stored in this working memory

  Specified by:
    `getClasses` in interface `AbleWorkingMemory`

### clear

    public void clear()

  Remove all objects stored in this working memory

  Specified by:
    `clear` in interface `AbleWorkingMemory`

### isEmpty

    public boolean isEmpty()

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

  Specified by:
    `isEmpty` in interface `AbleWorkingMemory`

### toString

    public java.lang.String toString()

  Format the contents of working memory into a String For display in an Inspector

### 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

  Specified by:
    `toArray` in interface `AbleWorkingMemory`
  Throws:
    `AbleDataException`

Overview | Package | Class | Use | Tree | Serialized | Deprecated | Index | Help
| ABLE 2.3.0 07/13/2005 14:21:00
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

(C) Copyright IBM Corporation 1999, 2005