Class AbstractIfExistsNode<LeftTuple_ extends Tuple,Right_>
- java.lang.Object
-
- org.optaplanner.constraint.streams.bavet.common.AbstractNode
-
- org.optaplanner.constraint.streams.bavet.common.AbstractIfExistsNode<LeftTuple_,Right_>
-
- Type Parameters:
LeftTuple_-Right_-
- All Implemented Interfaces:
LeftTupleLifecycle<LeftTuple_>,RightTupleLifecycle<UniTuple<Right_>>
- Direct Known Subclasses:
AbstractIndexedIfExistsNode,AbstractUnindexedIfExistsNode
public abstract class AbstractIfExistsNode<LeftTuple_ extends Tuple,Right_> extends AbstractNode implements LeftTupleLifecycle<LeftTuple_>, RightTupleLifecycle<UniTuple<Right_>>
This class has two direct children:AbstractIndexedIfExistsNodeandAbstractUnindexedIfExistsNode. The logic in either is identical, except that the latter removes all indexing work. Therefore any time that one of the classes changes, the other should be inspected if it could benefit from applying the change there too.
-
-
Field Summary
Fields Modifier and Type Field Description protected Queue<ExistsCounter<LeftTuple_>>dirtyCounterQueueprotected booleanisFilteringprotected booleanshouldExist
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractIfExistsNode(boolean shouldExist, TupleLifecycle<LeftTuple_> nextNodeTupleLifecycle, boolean isFiltering)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidcalculateScore()protected voidinsertOrUpdateCounter(ExistsCounter<LeftTuple_> counter)protected voidprocessAndClearCounters(Set<ExistsCounter<LeftTuple_>> counterSetRight)protected voidprocessCounters(Set<ExistsCounter<LeftTuple_>> counterSetRight)protected voidprocessCounterUpdate(ExistsCounter<LeftTuple_> counter)protected voidprocessInsert(LeftTuple_ leftTuple, UniTuple<Right_> rightTuple, ExistsCounter<LeftTuple_> counter, Set<ExistsCounter<LeftTuple_>> counterSetRight)protected voidprocessUpdate(LeftTuple_ leftTuple, UniTuple<Right_> rightTuple, ExistsCounter<LeftTuple_> counter, Set<ExistsCounter<LeftTuple_>> counterSetRight)protected voidretractCounter(ExistsCounter<LeftTuple_> counter)protected voidretractOrRemainDeadCounter(ExistsCounter<LeftTuple_> counter)protected abstract booleantestFiltering(LeftTuple_ leftTuple, UniTuple<Right_> rightTuple)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.optaplanner.constraint.streams.bavet.common.LeftTupleLifecycle
insertLeft, retractLeft, updateLeft
-
Methods inherited from interface org.optaplanner.constraint.streams.bavet.common.RightTupleLifecycle
insertRight, retractRight, updateRight
-
-
-
-
Field Detail
-
shouldExist
protected final boolean shouldExist
-
dirtyCounterQueue
protected final Queue<ExistsCounter<LeftTuple_ extends Tuple>> dirtyCounterQueue
-
isFiltering
protected final boolean isFiltering
-
-
Constructor Detail
-
AbstractIfExistsNode
protected AbstractIfExistsNode(boolean shouldExist, TupleLifecycle<LeftTuple_> nextNodeTupleLifecycle, boolean isFiltering)
-
-
Method Detail
-
testFiltering
protected abstract boolean testFiltering(LeftTuple_ leftTuple, UniTuple<Right_> rightTuple)
-
processInsert
protected final void processInsert(LeftTuple_ leftTuple, UniTuple<Right_> rightTuple, ExistsCounter<LeftTuple_> counter, Set<ExistsCounter<LeftTuple_>> counterSetRight)
-
processUpdate
protected final void processUpdate(LeftTuple_ leftTuple, UniTuple<Right_> rightTuple, ExistsCounter<LeftTuple_> counter, Set<ExistsCounter<LeftTuple_>> counterSetRight)
-
processAndClearCounters
protected final void processAndClearCounters(Set<ExistsCounter<LeftTuple_>> counterSetRight)
-
processCounters
protected final void processCounters(Set<ExistsCounter<LeftTuple_>> counterSetRight)
-
processCounterUpdate
protected final void processCounterUpdate(ExistsCounter<LeftTuple_> counter)
-
insertOrUpdateCounter
protected final void insertOrUpdateCounter(ExistsCounter<LeftTuple_> counter)
-
retractOrRemainDeadCounter
protected final void retractOrRemainDeadCounter(ExistsCounter<LeftTuple_> counter)
-
retractCounter
protected final void retractCounter(ExistsCounter<LeftTuple_> counter)
-
calculateScore
public final void calculateScore()
- Specified by:
calculateScorein classAbstractNode
-
-