/** * Get the next vertex. * * @param vertex the vertex * @return next vertex */ protected static Vertex<String> getNext(Vertex<String> vertex) { Set<Vertex<String>> children = getChildren(vertex); if (children.isEmpty()) return null; if (children.size() > 1) throw new IllegalArgumentException("Multiple children: " + vertex); return children.iterator().next(); }
@SuppressWarnings("unchecked") public void visit() { Vertex<String> parent = getParent(this); Set<Vertex<String>> children = getChildren(this); if (log.isTraceEnabled()) log.trace("Structure visit, parent: " + parent + ", children: " + children); visit((T)parent, children); }