proguard.classfile
Class ClassPool

java.lang.Object
  extended by proguard.classfile.ClassPool

public class ClassPool
extends java.lang.Object

This is a set of representations of classes. They can be enumerated or retrieved by name. They can also be accessed by means of class visitors.


Constructor Summary
ClassPool()
           
 
Method Summary
 void accept(ClassPoolVisitor classPoolVisitor)
          Applies the given ClassPoolVisitor to the class pool.
 void addClass(Clazz clazz)
          Adds the given Clazz to the class pool.
 void classAccept(java.lang.String className, ClassVisitor classVisitor)
          Applies the given ClassVisitor to the class with the given name, if it is present in the class pool.
 void classesAccept(ClassVisitor classVisitor)
          Applies the given ClassVisitor to all classes in the class pool, in random order.
 void classesAcceptAlphabetically(ClassVisitor classVisitor)
          Applies the given ClassVisitor to all classes in the class pool, in sorted order.
 java.util.Iterator classNames()
          Returns an Iterator of all class names in the class pool.
 void clear()
          Clears the class pool.
 Clazz getClass(java.lang.String className)
          Returns a Clazz from the class pool based on its name.
 void removeClass(Clazz clazz)
          Removes the given Clazz from the class pool.
 int size()
          Returns the number of classes in the class pool.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassPool

public ClassPool()
Method Detail

clear

public void clear()
Clears the class pool.


addClass

public void addClass(Clazz clazz)
Adds the given Clazz to the class pool.


removeClass

public void removeClass(Clazz clazz)
Removes the given Clazz from the class pool.


getClass

public Clazz getClass(java.lang.String className)
Returns a Clazz from the class pool based on its name. Returns null if the class with the given name is not in the class pool. Returns the base class if the class name is an array type.


classNames

public java.util.Iterator classNames()
Returns an Iterator of all class names in the class pool.


size

public int size()
Returns the number of classes in the class pool.


accept

public void accept(ClassPoolVisitor classPoolVisitor)
Applies the given ClassPoolVisitor to the class pool.


classesAccept

public void classesAccept(ClassVisitor classVisitor)
Applies the given ClassVisitor to all classes in the class pool, in random order.


classesAcceptAlphabetically

public void classesAcceptAlphabetically(ClassVisitor classVisitor)
Applies the given ClassVisitor to all classes in the class pool, in sorted order.


classAccept

public void classAccept(java.lang.String className,
                        ClassVisitor classVisitor)
Applies the given ClassVisitor to the class with the given name, if it is present in the class pool.