org.objectweb.carol.irmi
Class Hashes

java.lang.Object
  extended by org.objectweb.carol.irmi.Hashes

public class Hashes
extends java.lang.Object

The Hashes class contains static utility methods for converting between hashes and methods. The hash algorithm used is the one described in the RMI specification. Any converstions from Methods to hashes and from (Class, hash) to Method are statically cached.

Author:
Rafael H. Schloming <rhs@mit.edu>

Method Summary
static long getHash(java.lang.reflect.Method meth)
          Converts (and caches) the hash for the given Method.
static java.lang.reflect.Method getMethod(java.lang.Class klass, long hash)
          Searches a given Class for a Method having a given hash.
static long opnum(java.lang.reflect.Method method)
          Computes the RMI specified hash for the given method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getHash

public static long getHash(java.lang.reflect.Method meth)
Converts (and caches) the hash for the given Method. The hash algorithm used is the one described in the RMI specification.

Parameters:
meth - the Method to hash
Returns:
the hash code for meth

getMethod

public static java.lang.reflect.Method getMethod(java.lang.Class klass,
                                                 long hash)
Searches a given Class for a Method having a given hash. The result of this search is cached.

Parameters:
klass - the Class to search
hash - the hash of the desired method
Returns:
the Method matching the given hash, or null if none exists

opnum

public static long opnum(java.lang.reflect.Method method)
Computes the RMI specified hash for the given method.

Parameters:
method - the method to hash
Returns:
the RMI specified hash for method