@Override public void addNode(int id, String label, Map<String, Object> attributes) { super.addNode(id, label, attributes); if (id > this.maxNodeId) { this.maxNodeId = id; } }
@Override public void finishedParsing() { if (this.hasDirectedEdges) { super.setDirectedEdgeSchema(this.directedEdgeSchema); for (Edge e : edges) { if (e.isDirected()) { super.addDirectedEdge(e.getSource(), e.getTarget(), e.getAttributes()); } } } if (this.hasUndirectedEdges) { super.setUndirectedEdgeSchema(this.undirectedEdgeSchema); for (Edge e : edges) { if (!e.isDirected()) { super.addUndirectedEdge(e.getSource(), e.getTarget(), e.getAttributes()); } } } super.finishedParsing(); edges = null; }
private void doNodeInjection() { for (AnonymousNode node : nodesToAdd) { super.addNode(++this.maxNodeId, node.getLabel(), node.getAttributes()); } }
@Override public void setUndirectedEdgeSchema(LinkedHashMap<String, String> schema) { this.inputNodesHaveEnded(); super.setUndirectedEdgeSchema(schema); }
@Override public void finishedParsing() { this.inputNodesHaveEnded(); super.finishedParsing(); }
@Override public void setNodeCount(int numberOfNodes) { super.setNodeCount(numberOfNodes + nodesToAdd.size()); }