FileDocCategorySizeDatePackage
ClassSet.javaAPI DocJava SE 6 API3933Tue Jun 10 00:22:24 BST 2008com.sun.org.apache.bcel.internal.util

ClassSet

public class ClassSet extends Object implements Serializable
Utility class implementing a (typesafe) set of JavaClass objects. Since JavaClass has no equals() method, the name of the class is used for comparison.
version
$Id: ClassSet.java,v 1.1.2.1 2005/07/31 23:47:02 jeffsuttor Exp $
author
M. Dahm
see
ClassStack

Fields Summary
private HashMap
_map
Constructors Summary
Methods Summary
public booleanadd(com.sun.org.apache.bcel.internal.classfile.JavaClass clazz)


      
    boolean result = false;

    if(!_map.containsKey(clazz.getClassName())) {
      result = true;
      _map.put(clazz.getClassName(), clazz);
    }

    return result;
  
public booleanempty()

 return _map.isEmpty(); 
public java.lang.String[]getClassNames()

    return (String[])_map.keySet().toArray(new String[_map.keySet().size()]);
  
public voidremove(com.sun.org.apache.bcel.internal.classfile.JavaClass clazz)

 _map.remove(clazz.getClassName()); 
public com.sun.org.apache.bcel.internal.classfile.JavaClass[]toArray()

    Collection values = _map.values();
    JavaClass[] classes = new JavaClass[values.size()];
    values.toArray(classes);
    return classes;