/** * この要素からの出力ポートに対する、フロー部品内部の出力ポートを返す。 * * @param externalOutput この要素からの出力ポート * @return 対応するフロー部品内部の出力ポート * @throws IllegalArgumentException 引数に{@code null}が指定された場合 */ public FlowOut<?> getInternalOutputPort(FlowElementPortDescription externalOutput) { if (externalOutput == null) { throw new IllegalArgumentException("externalOutput must not be null"); // $NON-NLS-1$ } assert outputPorts.size() == flowGraph.getFlowOutputs().size(); int index = outputPorts.indexOf(externalOutput); if (index < 0) { throw new IllegalArgumentException(); } return flowGraph.getFlowOutputs().get(index); }
/** * Creates a new instance. * * @param flowGraph the flow-graph which represents this flow-part structure * @param parameters the parameters for this flow-part * @throws IllegalArgumentException if some parameters were {@code null} * @since 0.5.0 */ public FlowPartDescription(FlowGraph flowGraph, List<? extends Parameter> parameters) { if (flowGraph == null) { throw new IllegalArgumentException("flowGraph must not be null"); // $NON-NLS-1$ } if (parameters == null) { throw new IllegalArgumentException("parameters must not be null"); // $NON-NLS-1$ } this.flowGraph = flowGraph; List<FlowElementPortDescription> inputs = new ArrayList<FlowElementPortDescription>(); List<FlowElementPortDescription> outputs = new ArrayList<FlowElementPortDescription>(); this.inputPorts = Collections.unmodifiableList(inputs); this.outputPorts = Collections.unmodifiableList(outputs); this.parameters = Collections.unmodifiableList(new ArrayList<Parameter>(parameters)); for (FlowIn<?> in : flowGraph.getFlowInputs()) { inputs.add( new FlowElementPortDescription( in.getDescription().getName(), in.getDescription().getDataType(), PortDirection.INPUT)); } for (FlowOut<?> out : flowGraph.getFlowOutputs()) { outputs.add( new FlowElementPortDescription( out.getDescription().getName(), out.getDescription().getDataType(), PortDirection.OUTPUT)); } }