/** * Check the proposed port name against the set of input ports that the * activity has * * @param name * @param set * @return */ private boolean inputPortNameExists(String name, Set<ActivityInputPort> set) { for (Port port : set) { if (name.equals(port.getName())) { return true; } } return false; }
/** * Check the proposed port name against the set of output ports that the * activity has * * @param name * @param set * @return */ private boolean outputPortNameExists(String name, Set<OutputPort> set) { for (Port port : set) { if (name.equals(port.getName())) { return true; } } return false; }
private String describePort(Port port, TypeDescriptor descriptor) { String html = "<tr><tr>"+port.getName()+"</td></td>"; if (descriptor!=null && descriptor.isOptional()) { html += "<em>optional</em><br>"; } html+="Depth:"+port.getDepth()+"<br>"; if (descriptor != null )html+="<code>"+descriptor.getQname().toString()+"</code><br>"; html+="</td></tr>"; return html; }
/** * Check the proposed port name against the set of output ports that the * activity has * * @param name * @param set * @return */ private boolean outputPortNameExists(final String name, final Set<OutputPort> set) { for (final Port port : set) { if (name.equals(port.getName())) { return true; } } return false; }
private String describePort(Port port, TypeDescriptor descriptor) { String html = "<tr><td>"+port.getName()+"</td><td>"; if (descriptor!=null && descriptor.isOptional()) { html += "<em>optional</em><br>"; } html+="Depth:"+port.getDepth()+"<br>"; if (descriptor != null ) { html+="<code>"+descriptor.getQname().toString()+"</code><br>"; if (descriptor.getDocumentation() != null && !descriptor.getDocumentation().isEmpty()){ html += "<p>"+descriptor.getDocumentation()+"</p>"; } } html+="</td></tr>"; return html; }
/** * Check the proposed port name against the set of output ports that the * activity has * * @param name * @param set * @return */ private boolean outputPortNameExists(String name, Set<OutputPort> set) { for (Port port : set) { if (name.equals(port.getName())) { return true; } } return false; }
if (inPort.getName().equals("input1")) in1 = inPort; if (inPort.getName().equals("input2")) in2 = inPort; assertEquals("input1", in1.getName()); assertEquals(1, in1.getDepth()); assertEquals("input2", in2.getName()); assertEquals(0, in2.getDepth()); assertEquals("output", out1.getName()); assertEquals(0, out1.getDepth());
/** * Check the proposed port name against the set of input ports that the * activity has * * @param name * @param set * @return */ private boolean inputPortNameExists(String name, Set<ActivityInputPort> set) { for (Port port : set) { if (name.equals(port.getName())) { return true; } } return false; }
if (inPort.getName().equals("input1")) in1 = inPort; if (inPort.getName().equals("input2")) in2 = inPort; assertEquals("input1", in1.getName()); assertEquals(1, in1.getDepth()); assertEquals("input2", in2.getName()); assertEquals(0, in2.getDepth()); assertEquals("output", out1.getName()); assertEquals(0, out1.getDepth());
/** * Check the proposed port name against the set of input ports that the * activity has * * @param name * @param set * @return */ private boolean inputPortNameExists(String name, Set<ActivityInputPort> set) { for (Port port : set) { if (name.equals(port.getName())) { return true; } } return false; }
if (inPort.getName().equals("input1")) in1 = inPort; if (inPort.getName().equals("input2")) in2 = inPort; assertEquals("input1", in1.getName()); assertEquals(1, in1.getDepth()); assertEquals("input2", in2.getName()); assertEquals(0, in2.getDepth()); assertEquals("output", out1.getName()); assertEquals(0, out1.getDepth());
/** * Check the proposed port name against the set of output ports that the * activity has * * @param name * @param set * @return */ private boolean outputPortNameExists(String name, Set<OutputPort> set) { for (Port port : set) { if (name.equals(port.getName())) { return true; } } return false; }
/** * Check the proposed port name against the set of input ports that the * activity has * * @param name * @param set * @return */ private boolean inputPortNameExists(final String name, final Set<ActivityInputPort> set) { for (final Port port : set) { if (name.equals(port.getName())) { return true; } } return false; }
/** * Method for generating a valid filename for a port * * @param Port * the port to generate a filename for * @return the filename * */ private String generateFilename(Port port) { String portName = port.getName(); SemanticTypes semanticType = outputSymanticTypes .get(portName); String extension; if (semanticType == RshellPortTypes.SemanticTypes.PNG_FILE) { extension = ".png"; } else if (semanticType == RshellPortTypes.SemanticTypes.TEXT_FILE) { extension = ".txt"; } // else if (semanticType == RshellPortTypes.SemanticTypes.PDF_FILE) { // extension = ".pdf"; // } else { extension = ""; } return portName.replaceAll("\\W", "_") + extension; }
public static String findName(Port port) { if (port instanceof ProcessorPort) { String sourceProcessorName = ((ProcessorPort)port).getProcessor().getLocalName(); return sourceProcessorName + ":" + port.getName(); } else if (port instanceof MergePort) { String sourceMergeName = ((MergePort)port).getMerge().getLocalName(); return sourceMergeName + ":" + port.getName(); } else { return port.getName(); } } }
private String findName(Port port) { if (port instanceof ProcessorPort) { String sourceProcessorName = ((ProcessorPort)port).getProcessor().getLocalName(); return sourceProcessorName + ":" + port.getName(); } else if (port instanceof MergePort) { String sourceMergeName = ((MergePort)port).getMerge().getLocalName(); return sourceMergeName + ":" + port.getName(); } else { return port.getName(); } } }
existingNames.add(existingPort.getName().toLowerCase());