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

BetaRightMemory - JBoss RULES 3.0.6 API 英文版文档


org.drools.reteoo.beta
Interface BetaRightMemory

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
BooleanConstrainedRightMemory, DefaultRightMemory, InstanceEqualConstrRightMemory, ObjectEqualConstrRightMemory, ObjectNotEqualConstrRightMemory

public interface BetaRightMemory
extends java.io.Serializable

BetaRightMemory The BetaRightMemory is the interface for all classes implementing the right memory of a BetaMemory instance. The right memory is responsible for indexing and storing references to all input fact handles in the ReteOO network. Specialized implementations for this interface are capable of indexing and partitioning the fact handles with the objective of improve query time. Although, the implementations are all required to keep the order of objects, and iterate then in order with the iterator() method.


Method Summary
 void add(WorkingMemory workingMemory, MultiLinkedListNodeWrapper matches)
          Adds an object to the right memory
 void add(WorkingMemory workingMemory, ObjectMatches matches)
          Adds an object to the right memory
 BetaRightMemory getInnerMemory()
          Returns the inner beta right memory in case of a multi-indexed memory
 boolean isEmpty()
          Returns true if the memory is empty
 boolean isPossibleMatch(MultiLinkedListNodeWrapper matches)
          Returns true if the matches is a possible match to the tuple given to the previous selectPossibleMatches() call
 java.util.Iterator iterator()
          Returns an iterator that allows to iterate over all the ObjectMatches in the beta right memory.
 java.util.Iterator iterator(WorkingMemory workingMemory, ReteTuple tuple)
          Returns an iterator that allows to iterate over the ObjectMatches (and referenced FactHandles) that are possible matches to the given tuple.
 void remove(WorkingMemory workingMemory, MultiLinkedListNodeWrapper matches)
          Removes the given match from memory
 void remove(WorkingMemory workingMemory, ObjectMatches matches)
          Removes the given match from memory
 void selectPossibleMatches(WorkingMemory workingMemory, ReteTuple tuple)
          Prepares the right memory for subsequent calls of isPossibleMatch() based on the constraints applied to the tuples
 void setInnerMemory(BetaRightMemory innerMemory)
          Sets the inner beta right memory in case of a multi-indexed memory
 int size()
          Returns the number of objects currently stored in the right memory
 

Method Detail

add

void add(WorkingMemory workingMemory,
         ObjectMatches matches)
Adds an object to the right memory

Parameters:
workingMemory - the working memory reference
matches - the matches object (with the reference to the fact implementation)

remove

void remove(WorkingMemory workingMemory,
            ObjectMatches matches)
Removes the given match from memory

Parameters:
workingMemory - the working memory reference
matches -

add

void add(WorkingMemory workingMemory,
         MultiLinkedListNodeWrapper matches)
Adds an object to the right memory

Parameters:
workingMemory - the working memory reference
matches - the matches object (with the reference to the fact implementation)

remove

void remove(WorkingMemory workingMemory,
            MultiLinkedListNodeWrapper matches)
Removes the given match from memory

Parameters:
workingMemory - the working memory reference
matches -

iterator

java.util.Iterator iterator(WorkingMemory workingMemory,
                            ReteTuple tuple)
Returns an iterator that allows to iterate over the ObjectMatches (and referenced FactHandles) that are possible matches to the given tuple. IMPORTANT: this iterator should NOT implement/support the remove() method

Parameters:
workingMemory - the working memory reference
tuple - the tuple that will possibly join with the returned matches
Returns:

iterator

java.util.Iterator iterator()
Returns an iterator that allows to iterate over all the ObjectMatches in the beta right memory. This might not be much efficient for indexed memories, so this shall be used only when changing RETE network layoud (adding/removing rules).

Returns:

size

int size()
Returns the number of objects currently stored in the right memory

Returns:
the number of objects currently stored in the right memory

isEmpty

boolean isEmpty()
Returns true if the memory is empty

Returns:

selectPossibleMatches

void selectPossibleMatches(WorkingMemory workingMemory,
                           ReteTuple tuple)
Prepares the right memory for subsequent calls of isPossibleMatch() based on the constraints applied to the tuples

Parameters:
handle -

isPossibleMatch

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

Parameters:
matches -
Returns:

setInnerMemory

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

Parameters:
innerMemory -
Throws:
javax.naming.OperationNotSupportedException

getInnerMemory

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

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