# Class ClassSet

java.lang.Object
org.apache.bcel.util.ClassSet

public class ClassSet extends Object
Utility class implementing a (type-safe) set of JavaClass objects. Since JavaClass has no equals() method, the name of the class is used for comparison.

See Also:
  - `ClassStack`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ClassSet()`
  Constructs a new ClassSet.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `add(JavaClass clazz)`
  Adds a JavaClass to the set.
  `boolean`
  `empty()`
  Checks if the set is empty.
  `String[]`
  `getClassNames()`
  Gets the class names in the set.
  `void`
  `remove(JavaClass clazz)`
  Removes a JavaClass from the set.
  `JavaClass[]`
  `toArray()`
  Converts the set to an array.

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### ClassSet

    public ClassSet()
    Constructs a new ClassSet.

- ## Method Details

  - ### add

    public boolean add(JavaClass clazz)
    Adds a JavaClass to the set.
    Parameters:
      `clazz` - the JavaClass to add.
    Returns:
      true if the class was added.

  - ### empty

    public boolean empty()
    Checks if the set is empty.
    Returns:
      true if the set is empty.

  - ### getClassNames

    public String[] getClassNames()
    Gets the class names in the set.
    Returns:
      the class names in the set.

  - ### remove

    public void remove(JavaClass clazz)
    Removes a JavaClass from the set.
    Parameters:
      `clazz` - the JavaClass to remove.

  - ### toArray

    public JavaClass[] toArray()
    Converts the set to an array.
    Returns:
      an array of JavaClass objects.