Class AbstractConcatNode<LeftTuple_ extends AbstractTuple,RightTuple_ extends AbstractTuple,OutTuple_ extends AbstractTuple>

java.lang.Object
ai.timefold.solver.constraint.streams.bavet.common.AbstractNode
ai.timefold.solver.constraint.streams.bavet.common.AbstractConcatNode<LeftTuple_,RightTuple_,OutTuple_>
All Implemented Interfaces:
LeftTupleLifecycle<LeftTuple_>, RightTupleLifecycle<RightTuple_>

public abstract class AbstractConcatNode<LeftTuple_ extends AbstractTuple,RightTuple_ extends AbstractTuple,OutTuple_ extends AbstractTuple> extends AbstractNode implements LeftTupleLifecycle<LeftTuple_>, RightTupleLifecycle<RightTuple_>
Implements the concat operation. Concat cannot be implemented as a pass-through operation because of two caveats:
  • It is possible to have the same TupleSource for both parent streams, in which case the exact same tuple can be inserted twice. Such a tuple should be counted twice downstream, and thus need to be cloned.
  • Because concat has two parent nodes, it must be a TupleSource (since all nodes have exactly one TupleSource, and the source tuple can come from either parent). TupleSource must produce new tuples and not reuse them, since if tuples are reused, the stores inside them get corrupted.
The AbstractConcatNode works by creating a copy of the source tuple and putting it into the tuple's store. If the same tuple is inserted twice (i.e. when the left and right parent have the same TupleSource), it creates another clone.