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

ObjectEqualConstrRightMemory - JBoss RULES 3.0.6 API 英文版文档


org.drools.reteoo.beta
Class ObjectEqualConstrRightMemory

java.lang.Object
  extended by org.drools.reteoo.beta.ObjectEqualConstrRightMemory
All Implemented Interfaces:
java.io.Serializable, BetaRightMemory

public class ObjectEqualConstrRightMemory
extends java.lang.Object
implements BetaRightMemory

ObjectEqualConstrRightMemory An Equal Constrained Right Memory

See Also:
Serialized Form

Constructor Summary
ObjectEqualConstrRightMemory(FieldExtractor extractor, Declaration declaration, Evaluator evaluator)
           
ObjectEqualConstrRightMemory(FieldExtractor extractor, Declaration declaration, Evaluator evaluator, BetaRightMemory childMemory)
           
 
Method Summary
 void add(WorkingMemory workingMemory, MultiLinkedListNodeWrapper wrapper)
          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 isClean()
          Test method that checks if there is any garbage list in memory, what indicates an error.
 boolean isEmpty()
          Returns true if the memory is empty
 boolean isPossibleMatch(MultiLinkedListNodeWrapper wrapper)
          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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectEqualConstrRightMemory

public ObjectEqualConstrRightMemory(FieldExtractor extractor,
                                    Declaration declaration,
                                    Evaluator evaluator)

ObjectEqualConstrRightMemory

public ObjectEqualConstrRightMemory(FieldExtractor extractor,
                                    Declaration declaration,
                                    Evaluator evaluator,
                                    BetaRightMemory childMemory)
Method Detail

add

public final void add(WorkingMemory workingMemory,
                      ObjectMatches matches)
Description copied from interface: BetaRightMemory
Adds an object to the right memory

Specified by:
add in interface BetaRightMemory
Parameters:
workingMemory - the working memory reference
matches - the matches object (with the reference to the fact implementation)
See Also:
BetaRightMemory.add(org.drools.WorkingMemory, org.drools.reteoo.ObjectMatches)

remove

public final void remove(WorkingMemory workingMemory,
                         ObjectMatches matches)
Description copied from interface: BetaRightMemory
Removes the given match from memory

Specified by:
remove in interface BetaRightMemory
Parameters:
workingMemory - the working memory reference
See Also:
BetaRightMemory.remove(org.drools.WorkingMemory, org.drools.reteoo.ObjectMatches)

add

public final void add(WorkingMemory workingMemory,
                      MultiLinkedListNodeWrapper wrapper)
Description copied from interface: BetaRightMemory
Adds an object to the right memory

Specified by:
add in interface BetaRightMemory
Parameters:
workingMemory - the working memory reference
wrapper - the matches object (with the reference to the fact implementation)
See Also:
BetaRightMemory.add(org.drools.WorkingMemory, org.drools.util.MultiLinkedListNodeWrapper)

remove

public final void remove(WorkingMemory workingMemory,
                         MultiLinkedListNodeWrapper matches)
Description copied from interface: BetaRightMemory
Removes the given match from memory

Specified by:
remove in interface BetaRightMemory
Parameters:
workingMemory - the working memory reference
See Also:
BetaRightMemory.remove(org.drools.WorkingMemory, org.drools.util.MultiLinkedListNodeWrapper)

iterator

public final java.util.Iterator iterator(WorkingMemory workingMemory,
                                         ReteTuple tuple)
Description copied from interface: BetaRightMemory
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

Specified by:
iterator in interface BetaRightMemory
Parameters:
workingMemory - the working memory reference
tuple - the tuple that will possibly join with the returned matches
Returns:
See Also:
BetaRightMemory.iterator(org.drools.WorkingMemory, org.drools.reteoo.ReteTuple)

isEmpty

public final boolean isEmpty()
Description copied from interface: BetaRightMemory
Returns true if the memory is empty

Specified by:
isEmpty in interface BetaRightMemory
Returns:
See Also:
BetaRightMemory.isEmpty()

selectPossibleMatches

public final void selectPossibleMatches(WorkingMemory workingMemory,
                                        ReteTuple tuple)
Description copied from interface: BetaRightMemory
Prepares the right memory for subsequent calls of isPossibleMatch() based on the constraints applied to the tuples

Specified by:
selectPossibleMatches in interface BetaRightMemory
See Also:
BetaRightMemory.selectPossibleMatches(org.drools.WorkingMemory, org.drools.reteoo.ReteTuple)

isPossibleMatch

public final boolean isPossibleMatch(MultiLinkedListNodeWrapper wrapper)
Description copied from interface: BetaRightMemory
Returns true if the matches is a possible match to the tuple given to the previous selectPossibleMatches() call

Specified by:
isPossibleMatch in interface BetaRightMemory
Returns:

size

public final int size()
Description copied from interface: BetaRightMemory
Returns the number of objects currently stored in the right memory

Specified by:
size in interface BetaRightMemory
Returns:
the number of objects currently stored in the right memory

isClean

public final boolean isClean()
Test method that checks if there is any garbage list in memory, what indicates an error. It must be used only in unit tests.

Returns:

iterator

public final java.util.Iterator iterator()
Description copied from interface: BetaRightMemory
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).

Specified by:
iterator in interface BetaRightMemory
Returns:

getInnerMemory

public BetaRightMemory getInnerMemory()
Description copied from interface: BetaRightMemory
Returns the inner beta right memory in case of a multi-indexed memory

Specified by:
getInnerMemory in interface BetaRightMemory
Returns:
the inner beta right memory or null in case it is not a multi-indexed memory

setInnerMemory

public void setInnerMemory(BetaRightMemory innerMemory)
Description copied from interface: BetaRightMemory
Sets the inner beta right memory in case of a multi-indexed memory

Specified by:
setInnerMemory in interface BetaRightMemory