edu.rit.m2mi
Class MethodDescriptor

java.lang.Object
  extended by edu.rit.m2mi.MethodDescriptor

public class MethodDescriptor
extends Object

Class MethodDescriptor provides an object that describes a target method for an M2MI call. This includes the target interface name, target method name, and argument types. (The target method's return type is always void in M2MI.)

Class MethodDescriptor is not serializable and cannot be written to an object output stream using writeObject(), or read from an object input stream using readObject(). However, instances of class MethodDescriptor can be written to a data output stream using the write() method below, and instances of class MethodDescriptor can be read from a data input stream using the read() method below.


Constructor Summary
MethodDescriptor()
          Construct a new method descriptor.
MethodDescriptor(String theTargetInterface, String theTargetMethod, String theArgumentTypes)
          Construct a new method descriptor with the given target interface, target method, and argument types.
 
Method Summary
 boolean equals(Object obj)
          Determine if this method descriptor is equal to the given object.
 String getArgumentTypes()
          Returns this method descriptor's target method argument types.
 String getTargetInterface()
          Returns this method descriptor's fully-qualified target interface name.
 String getTargetMethod()
          Returns this method descriptor's target method name.
 int hashCode()
          Returns a hash code for this method descriptor.
 void read(DataInput theDataInput)
          Read this method descriptor's state from the given data input stream.
 String toString()
          Returns a string version of this method descriptor.
 void write(DataOutput theDataOutput)
          Write this method descriptor's state to the given data output stream.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MethodDescriptor

public MethodDescriptor()
Construct a new method descriptor. The method descriptor's state must be set using the read() method.


MethodDescriptor

public MethodDescriptor(String theTargetInterface,
                        String theTargetMethod,
                        String theArgumentTypes)
Construct a new method descriptor with the given target interface, target method, and argument types.

Parameters:
theTargetInterface - Fully-qualified name of the target interface.
theTargetMethod - Target method name.
theArgumentTypes - Target method's argument types, specified as a Java class file method descriptor string. The return type in the method descriptor string must be void.
Throws:
NullPointerException - (unchecked exception) Thrown if any argument is null.
Method Detail

getTargetInterface

public String getTargetInterface()
Returns this method descriptor's fully-qualified target interface name.


getTargetMethod

public String getTargetMethod()
Returns this method descriptor's target method name.


getArgumentTypes

public String getArgumentTypes()
Returns this method descriptor's target method argument types. The returned value is a Java class file method descriptor string.


write

public void write(DataOutput theDataOutput)
           throws IOException
Write this method descriptor's state to the given data output stream.

Parameters:
theDataOutput - Data output stream to write.
Throws:
IOException - Thrown if an I/O error occurred.

read

public void read(DataInput theDataInput)
          throws IOException
Read this method descriptor's state from the given data input stream. The stream is assumed to have been written by the write() method.

Parameters:
theDataInput - Data input stream to read.
Throws:
IOException - Thrown if an I/O error occurred.

equals

public boolean equals(Object obj)
Determine if this method descriptor is equal to the given object. To be equal, the given object must be a non-null instance of class MethodDescriptor with the same target interface name, target method name, and argument types as this method descriptor.

Overrides:
equals in class Object
Parameters:
obj - Object to test.
Returns:
True if this method descriptor equals obj, false otherwise.

hashCode

public int hashCode()
Returns a hash code for this method descriptor.

Overrides:
hashCode in class Object

toString

public String toString()
Returns a string version of this method descriptor.

Overrides:
toString in class Object


Copyright © 2001-2006 by Alan Kaminsky. All rights reserved. Send comments to ark­@­cs.rit.edu.