public void outputConnectTo(Operator outputOperator, int thatInputIndex) { this.connectTo(FINAL_OUTPUT_INDEX, outputOperator, thatInputIndex); }
/** * Creates a copy of the given {@link LoopOperator}. * * @param that should be copied */ public DoWhileOperator(DoWhileOperator<InputType, ConvergenceType> that) { super(that); this.criterionDescriptor = that.getCriterionDescriptor(); this.numExpectedIterations = that.getNumExpectedIterations(); this.state = that.getState(); this.initializeSlots(that.getInputType(), that.getConvergenceType()); }
@SuppressWarnings("unchecked") private SubplanPattern createSubplanPattern() { final OperatorPattern operatorPattern = new OperatorPattern( "loop", new DoWhileOperator<>(DataSetType.none(), DataSetType.none(), (PredicateDescriptor) null, 1), false); return SubplanPattern.createSingleton(operatorPattern); }
@Override public Collection<OutputSlot<?>> getForwards(InputSlot<?> input) { assert this.isOwnerOf(input); switch (input.getIndex()) { case INITIAL_INPUT_INDEX: case ITERATION_INPUT_INDEX: return Arrays.asList(this.getOutput(ITERATION_OUTPUT_INDEX), this.getOutput(FINAL_OUTPUT_INDEX)); default: return super.getForwards(input); } }
@Override public Collection<OutputSlot<?>> getLoopBodyOutputs() { return Collections.singletonList(this.getOutput(ITERATION_OUTPUT_INDEX)); }
/** * Creates a new instance. */ public DoWhileOperator(DataSetType<InputType> inputType, DataSetType<ConvergenceType> convergenceType, PredicateDescriptor<Collection<ConvergenceType>> criterionDescriptor, Integer numExpectedIterations) { super(3, 2, true); this.criterionDescriptor = criterionDescriptor; this.numExpectedIterations = numExpectedIterations; this.state = State.NOT_STARTED; this.initializeSlots(inputType, convergenceType); }
private SubplanPattern createSubplanPattern() { final OperatorPattern operatorPattern = new OperatorPattern( "loop", new DoWhileOperator<>(DataSetType.none(), DataSetType.none(), (PredicateDescriptor) null, 1), false ); return SubplanPattern.createSingleton(operatorPattern); }
@Override public Collection<OutputSlot<?>> getFinalLoopOutputs() { return Collections.singletonList(this.getOutput(FINAL_OUTPUT_INDEX)); }
@Override public Collection<InputSlot<?>> getConditionInputSlots() { return Collections.singletonList(this.getInput(CONVERGENCE_INPUT_INDEX)); }
public void beginIteration(Operator beginOperator, int beginInputIndex) { this.connectTo(ITERATION_OUTPUT_INDEX, beginOperator, beginInputIndex); }
@Override public Collection<InputSlot<?>> getLoopInitializationInputs() { return Collections.singletonList(this.getInput(INITIAL_INPUT_INDEX)); }
@SuppressWarnings("unchecked") public DataSetType<InputType> getInputType() { return ((InputSlot<InputType>) this.getInput(INITIAL_INPUT_INDEX)).getType(); }
@SuppressWarnings("unchecked") public DataSetType<ConvergenceType> getConvergenceType() { return ((InputSlot<ConvergenceType>) this.getInput(CONVERGENCE_INPUT_INDEX)).getType(); }