changeset 17051:c25fcf343b4f

improved javadoc for NodeClass.is()
author Doug Simon <doug.simon@oracle.com>
date Thu, 04 Sep 2014 22:33:17 +0200
parents 49b8c8932786
children 35fda668ed6e
files graal/com.oracle.graal.graph/src/com/oracle/graal/graph/NodeClass.java
diffstat 1 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/NodeClass.java	Thu Sep 04 22:32:49 2014 +0200
+++ b/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/NodeClass.java	Thu Sep 04 22:33:17 2014 +0200
@@ -340,7 +340,17 @@
     }
 
     /**
-     * Determines if a given {@link Node} class is described by the {@link NodeClass} object.
+     * Determines if a given {@link Node} class is described by this {@link NodeClass} object. This
+     * is useful for doing an exact type test (as opposed to an instanceof test) on a node. For
+     * example:
+     *
+     * <pre>
+     *     if (node.getNodeClass().is(BeginNode.class)) { ... }
+     *
+     *     // Due to generated Node classes, the test below
+     *     // is *not* the same as the test above:
+     *     if (node.getClass() == BeginNode.class) { ... }
+     * </pre>
      *
      * @param nodeClass a {@linkplain GeneratedNode non-generated} {@link Node} class
      */