public Node getNodeById(String nodeId) { return this.graphBuilder.getIdToNodeMap().get(nodeId); }
public ColumnNode getColumnNodeByHNodeId(String hNodeId) { Node n = this.graphBuilder.getIdToNodeMap().get(hNodeId); if (n != null && n instanceof ColumnNode) return (ColumnNode)n; else return null; // List<Node> columnNodes = this.getNodesByType(NodeType.ColumnNode); // if (columnNodes == null) return null; // for (Node cNode : columnNodes) { // if (((ColumnNode)cNode).getHNodeId().equals(hNodeId)) // return (ColumnNode)cNode; // } // return null; }
public List<LabeledLink> getLinks(String sourceId, String targetId) { List<LabeledLink> links = new LinkedList<>(); Node source = this.getIdToNodeMap().get(sourceId); if (source == null) return links; Node target = this.getIdToNodeMap().get(targetId); if (target == null) return links; Set<DefaultLink> allLinks = this.getGraph().getAllEdges(source, target); if (allLinks != null) { for (DefaultLink l : allLinks) { if (l instanceof LabeledLink) { links.add((LabeledLink)l); } } } return links; }
public List<LabeledLink> getOutgoingLinks(String nodeId) { List<LabeledLink> outgoingLinks = new LinkedList<>(); Node node = this.getIdToNodeMap().get(nodeId); if (node == null) return outgoingLinks; Set<DefaultLink> allOutgoingLinks = this.getGraph().outgoingEdgesOf(node); if (allOutgoingLinks != null) { for (DefaultLink l : allOutgoingLinks) { if (l instanceof LabeledLink) { outgoingLinks.add((LabeledLink)l); } } } return outgoingLinks; }
public List<LabeledLink> getIncomingLinks(String nodeId) { List<LabeledLink> incomingLinks = new LinkedList<>(); Node node = this.getIdToNodeMap().get(nodeId); if (node == null) return incomingLinks; Set<DefaultLink> allIncomingLinks = this.getGraph().incomingEdgesOf(node); if (allIncomingLinks != null) { for (DefaultLink l : allIncomingLinks) { if (l instanceof LabeledLink) { incomingLinks.add((LabeledLink)l); } } } return incomingLinks; }
if (steinerNodes != null) { for (Node n : steinerNodes) { if (this.graphBuilder.getIdToNodeMap().get(n.getId()) == null) { this.graphBuilder.addNodeAndUpdate(n);