Class ClassSet


  • public class ClassSet
    extends java.lang.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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean add​(JavaClass clazz)
      Adds a JavaClass to the set.
      boolean empty()
      Checks if the set is empty.
      java.lang.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 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ClassSet

        public ClassSet()
        Constructs a new ClassSet.
    • Method Detail

      • 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 java.lang.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.