@Override protected void doEditAction(ProcessorImpl processor) throws EditException { List<Activity<?>> activities = processor.activityList; if (activities.contains(activityToAdd) == false) { synchronized (processor) { activities.add(activityToAdd); } } else { throw new EditException( "Cannot add a duplicate activity to processor"); } }
@Override protected void doEditAction(ProcessorImpl processor) throws EditException { List<Activity<?>> activities = processor.activityList; if (activities.contains(activityToAdd) == false) { synchronized (processor) { activities.add(activityToAdd); } } else { throw new EditException( "Cannot add a duplicate activity to processor"); } }
@Override protected void doEditAction(MergeImpl mergeImpl) throws EditException { if (mergeInputPort instanceof MergeInputPortImpl) { mergeImpl.addInputPort((MergeInputPortImpl) mergeInputPort); } else { throw new EditException("The MergeInputPort is of the wrong implmentation, it should be of type MergeInputPortImpl"); } }
@SuppressWarnings("unchecked") public final TargetType doEdit() throws EditException { synchronized (subject) { if (applied) { throw new EditException("Edit already applied!"); } doEditAction(subject); this.applied = true; return (TargetType) subject; } }
@Override protected void doEditAction(DataflowImpl dataflow) throws EditException { if (dataflowOutputPort instanceof DataflowOutputPortImpl) { dataflow.addOutputPort((DataflowOutputPortImpl) dataflowOutputPort); } else { throw new EditException("The DataflowOutputPort is of the wrong implmentation, it should be of type DataflowOutputPortImpl"); } }
@Override protected void doEditAction(DataflowImpl dataflow) throws EditException { if (dataflowOutputPort instanceof DataflowOutputPortImpl) { dataflow.addOutputPort((DataflowOutputPortImpl) dataflowOutputPort); } else { throw new EditException("The DataflowOutputPort is of the wrong implmentation, it should be of type DataflowOutputPortImpl"); } }
@Override protected void doEditAction(MergeImpl mergeImpl) throws EditException { if (mergeInputPort instanceof MergeInputPortImpl) { mergeImpl.addInputPort((MergeInputPortImpl) mergeInputPort); } else { throw new EditException("The MergeInputPort is of the wrong implmentation, it should be of type MergeInputPortImpl"); } }
@Override protected void doEditAction(MergeImpl mergeImpl) throws EditException { if (mergeImpl instanceof MergeImpl) { mergeImpl.reorderInputPorts(reorderedInputPortList); } else { throw new EditException("The Merge is of the wrong implementation, it should be of type MergeImpl"); } }
@Override protected void doEditAction(DataflowImpl dataflow) throws EditException { if (dataflowInputPort instanceof DataflowInputPortImpl) { dataflow.addInputPort((DataflowInputPortImpl) dataflowInputPort); } else { throw new EditException("The DataflowInputPort is of the wrong implmentation, it should be of type DataflowInputPortImpl"); } }
@Override protected void doEditAction(ProcessorImpl control, ProcessorImpl target) throws EditException { condition = new ConditionImpl(control, target); // Check for duplicates for (Condition c : control.controlledConditions) { if (c.getTarget() == target) { throw new EditException("Attempt to create duplicate control link"); } } control.controlledConditions.add(condition); target.conditions.add(condition); }
@Override protected void doEditAction(AbstractActivity<?> activity) throws EditException { if (activity.getOutputPortMapping().containsKey(processorPortName)) throw new EditException("The mapping starting with:"+processorPortName+" already exists"); activity.getOutputPortMapping().put(processorPortName, activityPortName); }
@Override protected void doEditAction(AbstractActivity<?> activity) throws EditException { if (activity.getOutputPortMapping().containsKey(activityPortName)) throw new EditException("The mapping starting with:"+activityPortName+" already exists"); // Note javadoc of getOutputPortMapping - the mapping is activityPort -> processorPort // -- opposite of the outputPortMapping activity.getOutputPortMapping().put(activityPortName, processorPortName); }
@Override protected void doEditAction(ProcessorImpl control, ProcessorImpl target) throws EditException { condition = new ConditionImpl(control, target); // Check for duplicates for (Condition c : control.controlledConditions) { if (c.getTarget() == target) { throw new EditException("Attempt to create duplicate condition"); } } control.controlledConditions.add(condition); target.conditions.add(condition); }
@Override protected void doEditAction(ProcessorImpl control, ProcessorImpl target) throws EditException { condition = new ConditionImpl(control, target); // Check for duplicates for (Condition c : control.controlledConditions) { if (c.getTarget() == target) { throw new EditException("Attempt to create duplicate condition"); } } control.controlledConditions.add(condition); target.conditions.add(condition); }
@Override protected void doEditAction(ProcessorImpl processor) throws EditException { if (processor.getOutputPortWithName(portName) != null) { throw new EditException("Duplicate output port name"); } ProcessorOutputPortImpl pop = new ProcessorOutputPortImpl(processor,portName, portDepth, portGranularity); processor.outputPorts.add(pop); }
@Override protected void doEditAction(AbstractActivity<?> activity) throws EditException { if (!activity.getInputPortMapping().containsKey(processorPortName)) throw new EditException("The input port mapping for the processor port name:"+processorPortName+" doesn't exist"); oldValue=activity.getInputPortMapping().get(processorPortName); activity.getInputPortMapping().remove(processorPortName); }
@Override protected void doEditAction(AbstractActivity<?> activity) throws EditException { if (!activity.getOutputPortMapping().containsKey(processorPortName)) throw new EditException("The output port mapping for the processor port name:"+processorPortName+" doesn't exist"); oldValue=activity.getOutputPortMapping().get(processorPortName); activity.getOutputPortMapping().remove(processorPortName); }
@Override protected void doEditAction(AbstractActivity<?> activity) throws EditException { if (!activity.getOutputPortMapping().containsKey(processorPortName)) throw new EditException("The output port mapping for the processor port name:"+processorPortName+" doesn't exist"); oldValue=activity.getOutputPortMapping().get(processorPortName); activity.getOutputPortMapping().remove(processorPortName); }
@Override protected void doEditAction(AbstractActivity<?> activity) throws EditException { if (!activity.getInputPortMapping().containsKey(processorPortName)) throw new EditException("The input port mapping for the processor port name:"+processorPortName+" doesn't exist"); oldValue=activity.getInputPortMapping().get(processorPortName); activity.getInputPortMapping().remove(processorPortName); }
@Override protected void doEditAction(ProcessorImpl processor) throws EditException { if (processor.getOutputPortWithName(port.getName())==null) throw new EditException("The processor doesn't have a port named:"+port.getName()); processor.outputPorts.remove(port); }