protected void indexToPointer() throws GraphException {
for (String portID : this.inputPortIDs) {
PortImpl port = this.graph.getPort(portID);
if (port == null) {
throw new GraphException("Port, " + portID + ", does not exist.");
}
port.setKind(PortImpl.Kind.DATA_IN);
port.setNode(this);
this.inputPorts.add((DataPort) port);
}
for (String portID : this.outputPortIDs) {
PortImpl port = this.graph.getPort(portID);
if (port == null) {
throw new GraphException("Port, " + portID + ", does not exist.");
}
port.setKind(PortImpl.Kind.DATA_OUT);
port.setNode(this);
this.outputPorts.add((DataPort) port);
}
if (this.controlInPortID != null) {
PortImpl port = this.graph.getPort(this.controlInPortID);
if (port == null) {
throw new GraphException("Port, " + this.controlInPortID + ", does not exist.");
}
port.setKind(PortImpl.Kind.CONTROL_IN);
port.setNode(this);
this.controlInPort = (ControlPort) port;
}
for (String portID : this.controlOutPortIDs) {
PortImpl port = this.graph.getPort(portID);
if (port == null) {
throw new GraphException("Port, " + portID + ", does not exist.");
}
port.setKind(PortImpl.Kind.CONTROL_OUT);
port.setNode(this);
this.controlOutPorts.add((ControlPort) port);
}
if (this.eprPortID != null) {
PortImpl port = this.graph.getPort(this.eprPortID);
if (port == null) {
throw new GraphException("Port, " + this.eprPortID + ", does not exist.");
}
port.setKind(PortImpl.Kind.EPR);
port.setNode(this);
this.eprPort = port;
}