edu.ucsb.ccs.jcontractor.transformation
Class MethodSet

java.lang.Object
  |
  +--edu.ucsb.ccs.jcontractor.transformation.MethodSet

public class MethodSet
extends java.lang.Object

A simple container to hold MethodGen objects. Basically, just a specialized hashtable.

Version:
$Id: MethodSet.java,v 1.6 2002/05/22 06:29:17 parkera Exp $
Author:
Parker Abercrombie

Constructor Summary
MethodSet()
          Create an empty method set.
 
Method Summary
 org.apache.bcel.generic.MethodGen getMethod(java.lang.String name, java.lang.String signature)
          Retrieve a method from the set.
 void putMethod(org.apache.bcel.generic.MethodGen mg)
          Put a method into the set.
 void removeMethod(java.lang.String name, java.lang.String signature)
          Remove a method from the set.
 int size()
          Get the number of methods in the set.
 org.apache.bcel.generic.MethodGen[] toArray()
          Get an array representation of the methods in the set.
 java.lang.String toString()
          Get a string representation of the method set.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MethodSet

public MethodSet()
Create an empty method set.

Method Detail

putMethod

public void putMethod(org.apache.bcel.generic.MethodGen mg)
Put a method into the set. If the method was in the set already, it is replaced.

Parameters:
mg - the method to add or replace.

getMethod

public org.apache.bcel.generic.MethodGen getMethod(java.lang.String name,
                                                   java.lang.String signature)
Retrieve a method from the set.

Parameters:
name - the name of the method to retrieve.
signature - the signature of the method to retrieve.
Returns:
the MethodGen in the set that matches the given name and signature, if such a method is found. Otherwise null.

removeMethod

public void removeMethod(java.lang.String name,
                         java.lang.String signature)
Remove a method from the set. Has no effect if the specified method is not in the set.

Parameters:
name - the name of the method to remove.
signature - the signature of the method to remove.

size

public int size()
Get the number of methods in the set.

Returns:
the number of methods in the set.

toArray

public org.apache.bcel.generic.MethodGen[] toArray()
Get an array representation of the methods in the set.

Returns:
an array containing the methods in the set.

toString

public java.lang.String toString()
Get a string representation of the method set. Suitable for debugging.

Overrides:
toString in class java.lang.Object
Returns:
a string description of the method set.