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

BooleanConstrainedLeftMemory - JBoss RULES 3.0.6 API 英文版文档


org.drools.reteoo.beta
Class BooleanConstrainedLeftMemory

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

public class BooleanConstrainedLeftMemory
extends java.lang.Object
implements BetaLeftMemory

BooleanConstrainedLeftMemory A boolean constrained implementation for the left memory

See Also:
Serialized Form

Constructor Summary
BooleanConstrainedLeftMemory(FieldExtractor extractor, Declaration declaration, Evaluator evaluator)
           
BooleanConstrainedLeftMemory(FieldExtractor extractor, Declaration declaration, Evaluator evaluator, BetaLeftMemory childMemory)
           
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BooleanConstrainedLeftMemory

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

BooleanConstrainedLeftMemory

public BooleanConstrainedLeftMemory(FieldExtractor extractor,
                                    Declaration declaration,
                                    Evaluator evaluator,
                                    BetaLeftMemory childMemory)
Method Detail

add

public final void add(WorkingMemory workingMemory,
                      ReteTuple tuple)
Description copied from interface: BetaLeftMemory
Adds the given tuple to the memory

Specified by:
add in interface BetaLeftMemory
Parameters:
workingMemory - the working memory reference
tuple - the tuple to add
See Also:
BetaLeftMemory.add(org.drools.WorkingMemory, org.drools.reteoo.ReteTuple)

remove

public final void remove(WorkingMemory workingMemory,
                         ReteTuple tuple)
Description copied from interface: BetaLeftMemory
Remove the given tuple from the memory

Specified by:
remove in interface BetaLeftMemory
tuple - the tuple to remove
See Also:
org.drools.reteoo.beta.BetaLeftMemory#remove(org.drools.reteoo.ReteTuple)

add

public final void add(WorkingMemory workingMemory,
                      MultiLinkedListNodeWrapper tuple)
Description copied from interface: BetaLeftMemory
Adds the given tuple to the memory

Specified by:
add in interface BetaLeftMemory
Parameters:
workingMemory - the working memory reference
tuple - the tuple to add
See Also:
org.drools.reteoo.beta.BetaLeftMemory#add(org.drools.reteoo.ReteTuple)

remove

public final void remove(WorkingMemory workingMemory,
                         MultiLinkedListNodeWrapper tuple)
Description copied from interface: BetaLeftMemory
Remove the given tuple from the memory

Specified by:
remove in interface BetaLeftMemory
Parameters:
workingMemory - the working memory reference
tuple - the tuple to remove
See Also:
org.drools.reteoo.beta.BetaLeftMemory#remove(org.drools.reteoo.ReteTuple)

isEmpty

public final boolean isEmpty()
Description copied from interface: BetaLeftMemory
Checks if this memory is empty

Specified by:
isEmpty in interface BetaLeftMemory
Returns:
true if the memory is empty, false otherwise
See Also:
BetaLeftMemory.isEmpty()

iterator

public final java.util.Iterator iterator(WorkingMemory workingMemory,
                                         InternalFactHandle handle)
Description copied from interface: BetaLeftMemory
Returns an iterator to iterate over tuples that attend the binder/handle constraints

Specified by:
iterator in interface BetaLeftMemory
Parameters:
workingMemory - the working memory reference
handle - the handle whose tuples will try to join
Returns:
an Iterator over the tuples
See Also:
org.drools.reteoo.beta.BetaLeftMemory#iterator(org.drools.WorkingMemory, org.drools.reteoo.FactHandleImpl)

iterator

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

Specified by:
iterator in interface BetaLeftMemory
Returns:

selectPossibleMatches

public final void selectPossibleMatches(WorkingMemory workingMemory,
                                        InternalFactHandle handle)
Description copied from interface: BetaLeftMemory
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.

Specified by:
selectPossibleMatches in interface BetaLeftMemory
Parameters:
workingMemory - the working memory reference
handle - the handle whose tuples shall match
See Also:
org.drools.reteoo.beta.BetaLeftMemory#selectPossibleMatches(org.drools.WorkingMemory, org.drools.reteoo.FactHandleImpl)

isPossibleMatch

public final boolean isPossibleMatch(MultiLinkedListNodeWrapper tuple)
Description copied from interface: BetaLeftMemory
Returns true if the tuple is a possible match to the handle passed to the previous selectPossibleMatches() call

Specified by:
isPossibleMatch in interface BetaLeftMemory
Returns:
See Also:
BetaLeftMemory.isPossibleMatch(org.drools.util.MultiLinkedListNodeWrapper)

size

public final int size()
Description copied from interface: BetaLeftMemory
Returns the number of tuples currently stored in the left memory

Specified by:
size in interface BetaLeftMemory
Returns:
the number of tuples currently stored in the left memory

getInnerMemory

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

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

setInnerMemory

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

Specified by:
setInnerMemory in interface BetaLeftMemory