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:
AbstractIndexedIfExistsNode and AbstractUnindexedIfExistsNode.
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.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static final class -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Queue<ExistsCounter<LeftTuple_>>protected final intprotected final intprotected final booleanprotected final boolean -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractIfExistsNode(boolean shouldExist, int inputStoreIndexLeftTrackerList, int inputStoreIndexRightTrackerList, TupleLifecycle<LeftTuple_> nextNodesTupleLifecycle, boolean isFiltering) -
Method Summary
Modifier and TypeMethodDescriptionfinal voidprotected voiddecrementCounterRight(ExistsCounter<LeftTuple_> counter) protected voidincrementCounterRight(ExistsCounter<LeftTuple_> counter) protected voidinitCounterLeft(ExistsCounter<LeftTuple_> counter) protected voidkillCounterLeft(ExistsCounter<LeftTuple_> counter) protected abstract booleantestFiltering(LeftTuple_ leftTuple, UniTuple<Right_> rightTuple) protected voidupdateCounterFromLeft(LeftTuple_ leftTuple, UniTuple<Right_> rightTuple, ExistsCounter<LeftTuple_> counter, TupleList<AbstractIfExistsNode.FilteringTracker<LeftTuple_>> leftTrackerList) protected voidupdateCounterFromRight(UniTuple<Right_> rightTuple, ExistsCounter<LeftTuple_> counter, TupleList<AbstractIfExistsNode.FilteringTracker<LeftTuple_>> rightTrackerList) protected voidupdateCounterLeft(ExistsCounter<LeftTuple_> counter) protected TupleList<AbstractIfExistsNode.FilteringTracker<LeftTuple_>>updateRightTrackerList(UniTuple<Right_> rightTuple) protected final voidMethods inherited from class org.optaplanner.constraint.streams.bavet.common.AbstractNode
setId, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.optaplanner.constraint.streams.bavet.common.LeftTupleLifecycle
insertLeft, retractLeft, updateLeftMethods inherited from interface org.optaplanner.constraint.streams.bavet.common.RightTupleLifecycle
insertRight, retractRight, updateRight
-
Field Details
-
shouldExist
protected final boolean shouldExist -
inputStoreIndexLeftTrackerList
protected final int inputStoreIndexLeftTrackerList -
inputStoreIndexRightTrackerList
protected final int inputStoreIndexRightTrackerList -
isFiltering
protected final boolean isFiltering -
dirtyCounterQueue
-
-
Constructor Details
-
AbstractIfExistsNode
protected AbstractIfExistsNode(boolean shouldExist, int inputStoreIndexLeftTrackerList, int inputStoreIndexRightTrackerList, TupleLifecycle<LeftTuple_> nextNodesTupleLifecycle, boolean isFiltering)
-
-
Method Details
-
testFiltering
-
initCounterLeft
-
updateUnchangedCounterLeft
-
updateCounterLeft
-
killCounterLeft
-
incrementCounterRight
-
decrementCounterRight
-
updateRightTrackerList
protected TupleList<AbstractIfExistsNode.FilteringTracker<LeftTuple_>> updateRightTrackerList(UniTuple<Right_> rightTuple) -
updateCounterFromLeft
protected void updateCounterFromLeft(LeftTuple_ leftTuple, UniTuple<Right_> rightTuple, ExistsCounter<LeftTuple_> counter, TupleList<AbstractIfExistsNode.FilteringTracker<LeftTuple_>> leftTrackerList) -
updateCounterFromRight
protected void updateCounterFromRight(UniTuple<Right_> rightTuple, ExistsCounter<LeftTuple_> counter, TupleList<AbstractIfExistsNode.FilteringTracker<LeftTuple_>> rightTrackerList) -
calculateScore
public final void calculateScore()- Specified by:
calculateScorein classAbstractNode
-