Class ClassSet


  • public class ClassSet
    extends java.lang.Object
    Represents a set of classes. User can use isSubSetOf() to detect whether a given class is subclass of a class in the class set
    Version:
    $Id: ClassSet.java,v 1.3 2004/08/26 12:33:16 thlee Exp $ $Name: $
    Author:
    TiongHiang Lee (thlee@onemindsoft.org)
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.HashSet _classes
      the classes *
    • Constructor Summary

      Constructors 
      Constructor Description
      ClassSet()
      ClassSet​(java.util.Collection c)
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(java.lang.Class c)
      Add the class
      void addAll​(java.util.Collection classes)
      Add all in the classes to the ClassSet
      java.util.Set getClasses()
      Get the classes
      boolean isSubclassOfClasses​(java.lang.Class c)
      Check whether the class is subclass of one of the class in the class set
      • Methods inherited from class java.lang.Object

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

      • _classes

        private java.util.HashSet _classes
        the classes *
    • Constructor Detail

      • ClassSet

        public ClassSet()
      • ClassSet

        public ClassSet​(java.util.Collection c)
    • Method Detail

      • addAll

        public void addAll​(java.util.Collection classes)
        Add all in the classes to the ClassSet
        Parameters:
        classes - the collection containing the classes
      • add

        public void add​(java.lang.Class c)
        Add the class
        Parameters:
        c - the class
      • isSubclassOfClasses

        public boolean isSubclassOfClasses​(java.lang.Class c)
        Check whether the class is subclass of one of the class in the class set
        Parameters:
        c - the class
        Returns:
        true if is subclass
      • getClasses

        public java.util.Set getClasses()
        Get the classes
        Returns:
        the classes