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:AbstractIndexedJoinNodeandAbstractUnindexedJoinNode. 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<OutTuple_>dirtyTupleQueueprotected intinputStoreIndexLeftOutTupleListprotected intinputStoreIndexRightOutTupleListprotected booleanisFilteringprotected intoutputStoreIndexLeftOutEntryprotected intoutputStoreIndexRightOutEntry
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractJoinNode(int inputStoreIndexLeftOutTupleList, int inputStoreIndexRightOutTupleList, TupleLifecycle<OutTuple_> nextNodesTupleLifecycle, boolean isFiltering, int outputStoreIndexLeftOutEntry, int outputStoreIndexRightOutEntry)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidcalculateScore()protected abstract MutableOutTuple_createOutTuple(LeftTuple_ leftTuple, UniTuple<Right_> rightTuple)protected voidinsertOutTuple(LeftTuple_ leftTuple, UniTuple<Right_> rightTuple)protected 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)protected voidupdateOutTupleLeft(MutableOutTuple_ outTuple, LeftTuple_ leftTuple)protected voidupdateOutTupleRight(MutableOutTuple_ outTuple, UniTuple<Right_> rightTuple)-
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
-
inputStoreIndexLeftOutTupleList
protected final int inputStoreIndexLeftOutTupleList
-
inputStoreIndexRightOutTupleList
protected final int inputStoreIndexRightOutTupleList
-
isFiltering
protected final boolean isFiltering
-
outputStoreIndexLeftOutEntry
protected final int outputStoreIndexLeftOutEntry
-
outputStoreIndexRightOutEntry
protected final int outputStoreIndexRightOutEntry
-
-
Constructor Detail
-
AbstractJoinNode
protected AbstractJoinNode(int inputStoreIndexLeftOutTupleList, int inputStoreIndexRightOutTupleList, TupleLifecycle<OutTuple_> nextNodesTupleLifecycle, boolean isFiltering, int outputStoreIndexLeftOutEntry, int outputStoreIndexRightOutEntry)
-
-
Method Detail
-
createOutTuple
protected abstract MutableOutTuple_ createOutTuple(LeftTuple_ leftTuple, UniTuple<Right_> rightTuple)
-
setOutTupleLeftFacts
protected abstract void setOutTupleLeftFacts(MutableOutTuple_ outTuple, LeftTuple_ leftTuple)
-
setOutTupleRightFact
protected abstract void setOutTupleRightFact(MutableOutTuple_ outTuple, UniTuple<Right_> rightTuple)
-
testFiltering
protected abstract boolean testFiltering(LeftTuple_ leftTuple, UniTuple<Right_> rightTuple)
-
insertOutTuple
protected final void insertOutTuple(LeftTuple_ leftTuple, UniTuple<Right_> rightTuple)
-
updateOutTupleLeft
protected void updateOutTupleLeft(MutableOutTuple_ outTuple, LeftTuple_ leftTuple)
-
updateOutTupleRight
protected void updateOutTupleRight(MutableOutTuple_ outTuple, UniTuple<Right_> rightTuple)
-
retractOutTuple
protected final void retractOutTuple(MutableOutTuple_ outTuple)
-
calculateScore
public final void calculateScore()
- Specified by:
calculateScorein classAbstractNode
-
-