--- old/src/jdk.internal.vm.compiler/share/classes/org.graalvm.graphio/src/org/graalvm/graphio/GraphStructure.java 2017-11-03 23:57:45.250078493 -0700 +++ new/src/jdk.internal.vm.compiler/share/classes/org.graalvm.graphio/src/org/graalvm/graphio/GraphStructure.java 2017-11-03 23:57:44.924063904 -0700 @@ -38,9 +38,9 @@ */ public interface GraphStructure { /** - * Casts the provided object to graph, if possible. If the given object obj can be - * seen as a graph or sub-graph of a graph, then return the properly typed instance. Otherwise - * return null + * Casts {@code obj} to graph, if possible. If the given object obj can be seen as + * a graph or sub-graph of a graph, then return the properly typed instance. Otherwise return + * null * * @param currentGraph the currently processed graph * @param obj an object to check and view as a graph @@ -69,8 +69,8 @@ int nodesCount(G graph); /** - * Id of a node. Each node in the graph is uniquely identified by a integer value. If two nodes - * have the same id, then they shall be == to each other. + * Id of {@code node}. Each node in the graph is uniquely identified by an integer value. If two + * nodes have the same id, then they shall be == to each other. * * @param node the node to query for an id * @return the id of the node @@ -96,16 +96,35 @@ void nodeProperties(G graph, N node, Map properties); /** - * Finds the node class for the provided object, if possible. If the given object - * obj can be seen as an instance of node class or it is a node in this graph, - * return the properly typed instance of the node class. Otherwise return null + * Finds a node for {@code obj}, if possible. If the given object obj can be seen + * as an instance of node return the properly typed instance of the node class. Otherwise return + * null. + * + * @param obj an object to find node for + * @return appropriate graph object or null if the object doesn't represent a node + */ + N node(Object obj); + + /** + * Finds a node class for {@code obj}, if possible. If the given object obj can be + * seen as an instance of node class return the properly typed instance of the node class. + * Otherwise return null. * * @param obj an object to find node class for - * @return appropriate graph object or null if the object doesn't represent a graph + * @return appropriate graph object or null if the object doesn't represent a node + * class */ C nodeClass(Object obj); /** + * Finds a node class for {@code node}. + * + * @param node an instance of node in this graph + * @return the node's node class, never null + */ + C classForNode(N node); + + /** * The template used to build the name of nodes of this class. The template may use references * to inputs ({i#inputName}) and its properties ({p#propertyName}). *