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
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.Map<java.lang.String,​JavaClass> map  
    • 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
    • Field Detail

      • map

        private final java.util.Map<java.lang.String,​JavaClass> map
    • 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.