mjc

org.multijava.mjc
Class CAbstractMethodSet

java.lang.Object
  extended byorg.multijava.util.Utils
      extended byorg.multijava.mjc.CAbstractMethodSet
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
CMethodSet

public abstract class CAbstractMethodSet
extends Utils

This class encapsulates a collection of method signatures. It is used to track the type signatures of methods declared in a class and to track the apparent methods of a class as augmented by external methods as viewed by another compilation unit.


Nested Class Summary
 class CAbstractMethodSet.Iterator
          This nested class mimics the java.util.Iterator interface but is specific to collections of CMethod.
 
Field Summary
private  ArrayList methods
          The signatures of the methods in this collection.
 
Fields inherited from class org.multijava.util.Utils
DBG_LEVEL_HIGH, DBG_LEVEL_LOW, DBG_LEVEL_NO
 
Constructor Summary
protected CAbstractMethodSet()
           
protected CAbstractMethodSet(CMethod[] methodArray)
           
 
Method Summary
 void addMethod(CMethod m)
          Adds the given method to this method set.
 boolean contains(CMethod m)
          Indicates whether this set contains the given method.
 CMethod getFirst()
          Returns the first method in this collection or null if the collection is empty.
 CMethod getMethod(int i)
          Returns the method with the given index.
 boolean isEmpty()
          Indicates whether this set is empty.
 CAbstractMethodSet.Iterator iterator()
           
 int size()
          Indicates the number of methods in this collection.
 String toString()
           
 
Methods inherited from class org.multijava.util.Utils
assertTrue, assertTrue, combineArrays, escapeString, escapeString, fail, fail, getFilePath, hasFlag, hasOtherFlags, parsePathParts, relativePathTo, splitQualifiedName, splitQualifiedName, stripJavaModifiers, stripNonJavaModifiers, stripPrivateModifier, unescapeString, vectorToArray, vectorToIntArray
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

methods

private final ArrayList methods
The signatures of the methods in this collection.

Constructor Detail

CAbstractMethodSet

protected CAbstractMethodSet()

CAbstractMethodSet

protected CAbstractMethodSet(CMethod[] methodArray)
Method Detail

size

public int size()
Indicates the number of methods in this collection.

Returns:
the number of methods

isEmpty

public boolean isEmpty()
Indicates whether this set is empty.

Returns:
true iff this set is empty

contains

public boolean contains(CMethod m)
Indicates whether this set contains the given method.


getFirst

public CMethod getFirst()
Returns the first method in this collection or null if the collection is empty.

Returns:
the first method or null

toString

public String toString()
Overrides:
toString in class Object

addMethod

public void addMethod(CMethod m)
Adds the given method to this method set.

Parameters:
m - the method to be added to this set

getMethod

public CMethod getMethod(int i)
Returns the method with the given index.

Parameters:
i - the index of the method to return

iterator

public CAbstractMethodSet.Iterator iterator()

mjc

mjc is Copyright (C) 2000-2004 by Iowa State University and is distributed under the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. mjc is based in part on the Kopi project Copyright (C) 1990-99 DMS Decision Management Systems Ges.m.b.H.