diff graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/Signature.java @ 6539:2463eb24b644

Cleanup of Graal API: Rename methods so that it follows the getXxx naming convention and so that they are similar to the names of the java.lang.reflect classes. Remove unused methods.
author Christian Wimmer <christian.wimmer@oracle.com>
date Tue, 09 Oct 2012 15:23:38 -0700
parents 0c7e719c8bf8
children c07a49b27b89
line wrap: on
line diff
--- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/Signature.java	Tue Oct 09 14:06:26 2012 +0200
+++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/Signature.java	Tue Oct 09 15:23:38 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,66 +24,63 @@
 
 /**
  * Represents a method signature provided by the runtime.
- *
+ * 
  * @see <a href="http://java.sun.com/docs/books/jvms/second_edition/html/ClassFile.doc.html#7035">Method Descriptors</a>
  */
 public interface Signature {
+
     /**
-     * Gets the number of arguments in this signature, adding 1 for a receiver if requested.
-     *
+     * Returns the number of parameters in this signature, adding 1 for a receiver if requested.
+     * 
      * @param receiver true if 1 is to be added to the result for a receiver
-     * @return the number of arguments + 1 iff {@code receiver == true}
+     * @return the number of parameters; + 1 iff {@code receiver == true}
      */
-    int argumentCount(boolean receiver);
+    int getParameterCount(boolean receiver);
 
     /**
-     * Gets the argument type at the specified position. This method will return a
-     * {@linkplain ResolvedJavaType resolved} type if possible but without
-     * triggering any class loading or resolution.
-     *
+     * Gets the parameter type at the specified position. This method returns a {@linkplain ResolvedJavaType resolved}
+     * type if possible but without triggering any class loading or resolution.
+     * 
      * @param index the index into the parameters, with {@code 0} indicating the first parameter
-     * @param accessingClass the context of the type lookup. If accessing class is provided, its class loader
-     *        is used to retrieve an existing resolved type. This value can be {@code null} if the caller does
-     *        not care for a resolved type.
-     * @return the {@code index}'th argument type
+     * @param accessingClass the context of the type lookup. If accessing class is provided, its class loader is used to
+     *            retrieve an existing resolved type. This value can be {@code null} if the caller does not care for a
+     *            resolved type.
+     * @return the {@code index}'th parameter type
      */
-    JavaType argumentTypeAt(int index, ResolvedJavaType accessingClass);
-
-    /**
-     * Gets the argument kind at the specified position.
-     * @param index the index into the parameters, with {@code 0} indicating the first parameter
-     * @return the kind of the argument at the specified position
-     */
-    Kind argumentKindAt(int index);
+    JavaType getParameterType(int index, ResolvedJavaType accessingClass);
 
     /**
-     * Gets the return type of this signature. This method will return a
-     * {@linkplain ResolvedJavaType resolved} type if possible but without
-     * triggering any class loading or resolution.
-     *
-     * @param accessingClass the context of the type lookup. If accessing class is provided, its class loader
-     *        is used to retrieve an existing resolved type. This value can be {@code null} if the caller does
-     *        not care for a resolved type.
-     * @return the compiler interface type representing the return type
+     * Gets the parameter kind at the specified position. This is the same as calling {@link #getParameterType}.
+     * {@link JavaType#getKind getKind}.
+     * 
+     * @param index the index into the parameters, with {@code 0} indicating the first parameter
+     * @return the kind of the parameter at the specified position
      */
-    JavaType returnType(ResolvedJavaType accessingClass);
+    Kind getParameterKind(int index);
 
     /**
-     * Gets the return kind of this signature.
-     * @return the return kind
+     * Gets the return type of this signature. This method will return a {@linkplain ResolvedJavaType resolved} type if
+     * possible but without triggering any class loading or resolution.
+     * 
+     * @param accessingClass the context of the type lookup. If accessing class is provided, its class loader is used to
+     *            retrieve an existing resolved type. This value can be {@code null} if the caller does not care for a
+     *            resolved type.
+     * @return the return type
      */
-    Kind returnKind();
+    JavaType getReturnType(ResolvedJavaType accessingClass);
 
     /**
-     * Converts this signature to a string.
-     * @return the signature as a string
+     * Gets the return kind of this signature. This is the same as calling {@link #getReturnType}.
+     * {@link JavaType#getKind getKind}.
      */
-    String asString();
+    Kind getReturnKind();
 
     /**
-     * Gets the size, in Java slots, of the arguments to this signature.
-     * @param withReceiver {@code true} if to add a slot for a receiver object; {@code false} not to include the receiver
-     * @return the size of the arguments in slots
+     * Gets the size, in Java slots, of the parameters to this signature.
+     * 
+     * @param withReceiver {@code true} if to add a slot for a receiver object; {@code false} not to include the
+     *            receiver
+     * @return the size of the parameters in slots
      */
-    int argumentSlots(boolean withReceiver);
+    int getParameterSlots(boolean withReceiver);
 }