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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classAbstractIfExistsNode.FilteringTracker
-
Field Summary
Fields Modifier and Type Field Description protected Queue<ExistsCounter<LeftTuple_>>dirtyCounterQueueprotected intinputStoreIndexLeftTrackerListprotected intinputStoreIndexRightTrackerListprotected booleanisFilteringprotected booleanshouldExist
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractIfExistsNode(boolean shouldExist, int inputStoreIndexLeftTrackerList, int inputStoreIndexRightTrackerList, TupleLifecycle<LeftTuple_> nextNodesTupleLifecycle, boolean isFiltering)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidcalculateScore()protected 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 voidupdateCounterLeft(ExistsCounter<LeftTuple_> counter)protected voidupdateUnchangedCounterLeft(ExistsCounter<LeftTuple_> counter)-
Methods inherited from class org.optaplanner.constraint.streams.bavet.common.AbstractNode
setId, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, 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
-
inputStoreIndexLeftTrackerList
protected final int inputStoreIndexLeftTrackerList
-
inputStoreIndexRightTrackerList
protected final int inputStoreIndexRightTrackerList
-
isFiltering
protected final boolean isFiltering
-
dirtyCounterQueue
protected final Queue<ExistsCounter<LeftTuple_ extends Tuple>> dirtyCounterQueue
-
-
Constructor Detail
-
AbstractIfExistsNode
protected AbstractIfExistsNode(boolean shouldExist, int inputStoreIndexLeftTrackerList, int inputStoreIndexRightTrackerList, TupleLifecycle<LeftTuple_> nextNodesTupleLifecycle, boolean isFiltering)
-
-
Method Detail
-
testFiltering
protected abstract boolean testFiltering(LeftTuple_ leftTuple, UniTuple<Right_> rightTuple)
-
initCounterLeft
protected void initCounterLeft(ExistsCounter<LeftTuple_> counter)
-
updateUnchangedCounterLeft
protected final void updateUnchangedCounterLeft(ExistsCounter<LeftTuple_> counter)
-
updateCounterLeft
protected void updateCounterLeft(ExistsCounter<LeftTuple_> counter)
-
killCounterLeft
protected void killCounterLeft(ExistsCounter<LeftTuple_> counter)
-
incrementCounterRight
protected void incrementCounterRight(ExistsCounter<LeftTuple_> counter)
-
decrementCounterRight
protected void decrementCounterRight(ExistsCounter<LeftTuple_> counter)
-
calculateScore
public final void calculateScore()
- Specified by:
calculateScorein classAbstractNode
-
-