Class AbstractJoinNode<LeftTuple_ extends Tuple,Right_,OutTuple_ extends Tuple,MutableOutTuple_ extends OutTuple_>
java.lang.Object
org.optaplanner.constraint.streams.bavet.common.AbstractNode
org.optaplanner.constraint.streams.bavet.common.AbstractJoinNode<LeftTuple_,Right_,OutTuple_,MutableOutTuple_>
- Type Parameters:
LeftTuple_-Right_-
- All Implemented Interfaces:
LeftTupleLifecycle<LeftTuple_>,RightTupleLifecycle<UniTuple<Right_>>
- Direct Known Subclasses:
AbstractIndexedJoinNode,AbstractUnindexedJoinNode
public abstract class AbstractJoinNode<LeftTuple_ extends Tuple,Right_,OutTuple_ extends Tuple,MutableOutTuple_ extends OutTuple_>
extends AbstractNode
implements LeftTupleLifecycle<LeftTuple_>, RightTupleLifecycle<UniTuple<Right_>>
This class has two direct children:
AbstractIndexedJoinNode and AbstractUnindexedJoinNode.
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
FieldsModifier and TypeFieldDescriptionprotected final intprotected final int -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractJoinNode(int inputStoreIndexLeftOutTupleList, int inputStoreIndexRightOutTupleList, TupleLifecycle<OutTuple_> nextNodesTupleLifecycle, boolean isFiltering, int outputStoreIndexLeftOutEntry, int outputStoreIndexRightOutEntry) -
Method Summary
Modifier and TypeMethodDescriptionfinal voidprotected abstract MutableOutTuple_createOutTuple(LeftTuple_ leftTuple, UniTuple<Right_> rightTuple) protected final voidinnerUpdateLeft(LeftTuple_ leftTuple, Consumer<Consumer<UniTuple<Right_>>> rightTupleConsumer) protected final voidinnerUpdateRight(UniTuple<Right_> rightTuple, Consumer<Consumer<LeftTuple_>> leftTupleConsumer) protected final voidinsertOutTuple(LeftTuple_ leftTuple, UniTuple<Right_> rightTuple) protected final voidinsertOutTupleFiltered(LeftTuple_ leftTuple, UniTuple<Right_> rightTuple) protected final voidretractOutTuple(MutableOutTuple_ outTuple) protected abstract voidsetOutTupleLeftFacts(MutableOutTuple_ outTuple, LeftTuple_ leftTuple) protected abstract voidsetOutTupleRightFact(MutableOutTuple_ outTuple, UniTuple<Right_> rightTuple) protected abstract booleantestFiltering(LeftTuple_ leftTuple, UniTuple<Right_> rightTuple) Methods 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
-
inputStoreIndexLeftOutTupleList
protected final int inputStoreIndexLeftOutTupleList -
inputStoreIndexRightOutTupleList
protected final int inputStoreIndexRightOutTupleList -
dirtyTupleQueue
-
-
Constructor Details
-
AbstractJoinNode
protected AbstractJoinNode(int inputStoreIndexLeftOutTupleList, int inputStoreIndexRightOutTupleList, TupleLifecycle<OutTuple_> nextNodesTupleLifecycle, boolean isFiltering, int outputStoreIndexLeftOutEntry, int outputStoreIndexRightOutEntry)
-
-
Method Details
-
createOutTuple
protected abstract MutableOutTuple_ createOutTuple(LeftTuple_ leftTuple, UniTuple<Right_> rightTuple) -
setOutTupleLeftFacts
-
setOutTupleRightFact
protected abstract void setOutTupleRightFact(MutableOutTuple_ outTuple, UniTuple<Right_> rightTuple) -
testFiltering
-
insertOutTuple
-
insertOutTupleFiltered
-
innerUpdateLeft
protected final void innerUpdateLeft(LeftTuple_ leftTuple, Consumer<Consumer<UniTuple<Right_>>> rightTupleConsumer) -
innerUpdateRight
protected final void innerUpdateRight(UniTuple<Right_> rightTuple, Consumer<Consumer<LeftTuple_>> leftTupleConsumer) -
retractOutTuple
-
calculateScore
public final void calculateScore()- Specified by:
calculateScorein classAbstractNode
-