站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss RULES 3.0.6 API 英文版文档

BetaLeftMemory - JBoss RULES 3.0.6 API 英文版文档


org.drools.reteoo.beta
Interface BetaLeftMemory

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
BooleanConstrainedLeftMemory, DefaultLeftMemory, ObjectEqualConstrLeftMemory, ObjectNotEqualConstrLeftMemory

public interface BetaLeftMemory
extends java.io.Serializable

BetaLeftMemory The BetaLeftMemory is the interface for all classes implementing the left memory of a BetaMemory instance. The left memory is responsible for indexing and storing references to all input tuples in the ReteOO network. Specialized implementations for this interface are capable of indexing and partitioning the tuples with the objective of improve query time. Although, the implementations are all required to keep the order of objects, and return then in order when iterating over.


Method Summary
 void add(WorkingMemory workingMemory, MultiLinkedListNodeWrapper tuple)
          Adds the given tuple to the memory
 void add(WorkingMemory workingMemory, ReteTuple tuple)
          Adds the given tuple to the memory
 BetaLeftMemory getInnerMemory()
          Returns the inner beta left memory in case of a multi-indexed memory
 boolean isEmpty()
          Checks if this memory is empty
 boolean isPossibleMatch(MultiLinkedListNodeWrapper tuple)
          Returns true if the tuple is a possible match to the handle passed to the previous selectPossibleMatches() call
 java.util.Iterator iterator()
          Returns an iterator to iterate over all tuples in the beta left memory This method is much heavier than the iterator(workingMemory, handle) method as it is not backed by a data structure.
 java.util.Iterator iterator(WorkingMemory workingMemory, InternalFactHandle handle)
          Returns an iterator to iterate over tuples that attend the binder/handle constraints
 void remove(WorkingMemory workingMemory, MultiLinkedListNodeWrapper tuple)
          Remove the given tuple from the memory
 void remove(WorkingMemory workingMemory, ReteTuple tuple)
          Remove the given tuple from the memory
 void selectPossibleMatches(WorkingMemory workingMemory, InternalFactHandle handle)
          Prepares the left memory for subsequent calls of isPossibleMatch() based on the constraints applied to the handle.
 void setInnerMemory(BetaLeftMemory innerMemory)
          Sets the inner beta left memory in case of a multi-indexed memory
 int size()
          Returns the number of tuples currently stored in the left memory
 

Method Detail

add

void add(WorkingMemory workingMemory,
         MultiLinkedListNodeWrapper tuple)
Adds the given tuple to the memory

Parameters:
workingMemory - the working memory reference
tuple - the tuple to add

remove

void remove(WorkingMemory workingMemory,
            MultiLinkedListNodeWrapper tuple)
Remove the given tuple from the memory

Parameters:
workingMemory - the working memory reference
tuple - the tuple to remove

add

void add(WorkingMemory workingMemory,
         ReteTuple tuple)
Adds the given tuple to the memory

Parameters:
workingMemory - the working memory reference
tuple - the tuple to add

remove

void remove(WorkingMemory workingMemory,
            ReteTuple tuple)
Remove the given tuple from the memory

Parameters:
tuple - the tuple to remove

iterator

java.util.Iterator iterator(WorkingMemory workingMemory,
                            InternalFactHandle handle)
Returns an iterator to iterate over tuples that attend the binder/handle constraints

Parameters:
workingMemory - the working memory reference
handle - the handle whose tuples will try to join
Returns:
an Iterator over the tuples

iterator

java.util.Iterator iterator()
Returns an iterator to iterate over all tuples in the beta left memory This method is much heavier than the iterator(workingMemory, handle) method as it is not backed by a data structure. Order of elements are dynamically calculated, so, avoid using it if possible.

Returns:

size

int size()
Returns the number of tuples currently stored in the left memory

Returns:
the number of tuples currently stored in the left memory

isEmpty

boolean isEmpty()
Checks if this memory is empty

Returns:
true if the memory is empty, false otherwise

selectPossibleMatches

void selectPossibleMatches(WorkingMemory workingMemory,
                           InternalFactHandle handle)
Prepares the left memory for subsequent calls of isPossibleMatch() based on the constraints applied to the handle. Also, iterator() usually calls this method to select tuples to iterate over.

Parameters:
workingMemory - the working memory reference
handle - the handle whose tuples shall match

isPossibleMatch

boolean isPossibleMatch(MultiLinkedListNodeWrapper tuple)
Returns true if the tuple is a possible match to the handle passed to the previous selectPossibleMatches() call

Parameters:
tuple -
Returns:

setInnerMemory

void setInnerMemory(BetaLeftMemory innerMemory)
                    throws javax.naming.OperationNotSupportedException
Sets the inner beta left memory in case of a multi-indexed memory

Parameters:
innerMemory -
Throws:
javax.naming.OperationNotSupportedException

getInnerMemory

BetaLeftMemory getInnerMemory()
                              throws javax.naming.OperationNotSupportedException
Returns the inner beta left memory in case of a multi-indexed memory

Returns:
the inner beta left memory or null in case it is not a multi-indexed memory
Throws:
javax.naming.OperationNotSupportedException