langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/util/ClassDocCatalog.java
changeset 38617 d93a7f64e231
parent 25874 83c19f00452c
--- a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/util/ClassDocCatalog.java	Fri May 27 12:37:18 2016 -0700
+++ b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/util/ClassDocCatalog.java	Fri May 27 13:06:58 2016 -0700
@@ -44,31 +44,31 @@
  * @author Jamie Ho
  * @since 1.4
  */
-
- public class ClassDocCatalog {
+@Deprecated
+public class ClassDocCatalog {
 
-     /**
-      * Stores the set of packages that the classes specified on the command line
-      * belong to.  Note that the default package is "".
-      */
-     private Set<String> packageSet;
+    /**
+     * Stores the set of packages that the classes specified on the command line
+     * belong to.  Note that the default package is "".
+     */
+    private Set<String> packageSet;
 
 
-     /**
-      * Stores all classes for each package
-      */
-     private Map<String,Set<ClassDoc>> allClasses;
+    /**
+     * Stores all classes for each package
+     */
+    private Map<String,Set<ClassDoc>> allClasses;
 
-     /**
-      * Stores ordinary classes (excluding Exceptions and Errors) for each
-      * package
-      */
-     private Map<String,Set<ClassDoc>> ordinaryClasses;
+    /**
+     * Stores ordinary classes (excluding Exceptions and Errors) for each
+     * package
+     */
+    private Map<String,Set<ClassDoc>> ordinaryClasses;
 
-     /**
-      * Stores exceptions for each package
-      */
-     private Map<String,Set<ClassDoc>> exceptions;
+    /**
+     * Stores exceptions for each package
+     */
+    private Map<String,Set<ClassDoc>> exceptions;
 
     /**
      * Stores enums for each package.
@@ -80,57 +80,57 @@
      */
     private Map<String,Set<ClassDoc>> annotationTypes;
 
-     /**
-      * Stores errors for each package
-      */
-     private Map<String,Set<ClassDoc>> errors;
+    /**
+     * Stores errors for each package
+     */
+    private Map<String,Set<ClassDoc>> errors;
 
-     /**
-      * Stores interfaces for each package
-      */
-     private Map<String,Set<ClassDoc>> interfaces;
+    /**
+     * Stores interfaces for each package
+     */
+    private Map<String,Set<ClassDoc>> interfaces;
 
-     private Configuration configuration;
-     private Utils utils;
+    private Configuration configuration;
+    private Utils utils;
 
-     /**
-      * Construct a new ClassDocCatalog.
-      *
-      * @param classdocs the array of ClassDocs to catalog
-      */
-     public ClassDocCatalog (ClassDoc[] classdocs, Configuration config) {
-         init();
-         this.configuration = config;
-         this.utils = config.utils;
-         for (ClassDoc classdoc : classdocs) {
-             addClassDoc(classdoc);
-         }
-     }
+    /**
+     * Construct a new ClassDocCatalog.
+     *
+     * @param classdocs the array of ClassDocs to catalog
+     */
+    public ClassDocCatalog (ClassDoc[] classdocs, Configuration config) {
+        init();
+        this.configuration = config;
+        this.utils = config.utils;
+        for (ClassDoc classdoc : classdocs) {
+            addClassDoc(classdoc);
+        }
+    }
 
-     /**
-      * Construct a new ClassDocCatalog.
-      *
-      */
-     public ClassDocCatalog () {
-         init();
-     }
+    /**
+     * Construct a new ClassDocCatalog.
+     *
+     */
+    public ClassDocCatalog () {
+        init();
+    }
 
-     private void init() {
-         allClasses = new HashMap<>();
-         ordinaryClasses = new HashMap<>();
-         exceptions = new HashMap<>();
-         enums = new HashMap<>();
-         annotationTypes = new HashMap<>();
-         errors = new HashMap<>();
-         interfaces = new HashMap<>();
-         packageSet = new HashSet<>();
-     }
+    private void init() {
+        allClasses = new HashMap<>();
+        ordinaryClasses = new HashMap<>();
+        exceptions = new HashMap<>();
+        enums = new HashMap<>();
+        annotationTypes = new HashMap<>();
+        errors = new HashMap<>();
+        interfaces = new HashMap<>();
+        packageSet = new HashSet<>();
+    }
 
-     /**
-      * Add the given class to the catalog.
-      * @param classdoc the ClassDoc to add to the catelog.
-      */
-      public void addClassDoc(ClassDoc classdoc) {
+    /**
+     * Add the given class to the catalog.
+     * @param classdoc the ClassDoc to add to the catelog.
+     */
+    public void addClassDoc(ClassDoc classdoc) {
         if (classdoc == null) {
             return;
         }
@@ -148,139 +148,139 @@
         } else if (classdoc.isInterface()) {
             addClass(classdoc, interfaces);
         }
-      }
+    }
 
-      /**
-       * Add the given class to the given map.
-       * @param classdoc the ClassDoc to add to the catelog.
-       * @param map the Map to add the ClassDoc to.
-       */
-      private void addClass(ClassDoc classdoc, Map<String,Set<ClassDoc>> map) {
+    /**
+     * Add the given class to the given map.
+     * @param classdoc the ClassDoc to add to the catelog.
+     * @param map the Map to add the ClassDoc to.
+     */
+    private void addClass(ClassDoc classdoc, Map<String,Set<ClassDoc>> map) {
 
-          PackageDoc pkg = classdoc.containingPackage();
-          if (pkg.isIncluded() || (configuration.nodeprecated && utils.isDeprecated(pkg))) {
-              //No need to catalog this class if it's package is
-              //included on the command line or if -nodeprecated option is set
-              // and the containing package is marked as deprecated.
-              return;
-          }
-          String key = utils.getPackageName(pkg);
-          Set<ClassDoc> s = map.get(key);
-          if (s == null) {
-              packageSet.add(key);
-              s = new HashSet<>();
-          }
-          s.add(classdoc);
-          map.put(key, s);
+        PackageDoc pkg = classdoc.containingPackage();
+        if (pkg.isIncluded() || (configuration.nodeprecated && utils.isDeprecated(pkg))) {
+            //No need to catalog this class if it's package is
+            //included on the command line or if -nodeprecated option is set
+            // and the containing package is marked as deprecated.
+            return;
+        }
+        String key = utils.getPackageName(pkg);
+        Set<ClassDoc> s = map.get(key);
+        if (s == null) {
+            packageSet.add(key);
+            s = new HashSet<>();
+        }
+        s.add(classdoc);
+        map.put(key, s);
 
-      }
+    }
 
-      private ClassDoc[] getArray(Map<String,Set<ClassDoc>> m, String key) {
-          Set<ClassDoc> s = m.get(key);
-          if (s == null) {
-              return new ClassDoc[] {};
-          } else {
-              return s.toArray(new ClassDoc[] {});
-          }
-      }
+    private ClassDoc[] getArray(Map<String,Set<ClassDoc>> m, String key) {
+        Set<ClassDoc> s = m.get(key);
+        if (s == null) {
+            return new ClassDoc[] {};
+        } else {
+            return s.toArray(new ClassDoc[] {});
+        }
+    }
 
-      /**
-       * Return all of the classes specified on the command-line that
-       * belong to the given package.
-       * @param pkgDoc the package to return the classes for.
-       */
-      public ClassDoc[] allClasses(PackageDoc pkgDoc) {
-          return pkgDoc.isIncluded() ?
-                pkgDoc.allClasses() :
-                getArray(allClasses, utils.getPackageName(pkgDoc));
-      }
+    /**
+     * Return all of the classes specified on the command-line that
+     * belong to the given package.
+     * @param pkgDoc the package to return the classes for.
+     */
+    public ClassDoc[] allClasses(PackageDoc pkgDoc) {
+        return pkgDoc.isIncluded() ?
+              pkgDoc.allClasses() :
+              getArray(allClasses, utils.getPackageName(pkgDoc));
+    }
 
-      /**
-       * Return all of the classes specified on the command-line that
-       * belong to the given package.
-       * @param packageName the name of the package specified on the
-       * command-line.
-       */
-      public ClassDoc[] allClasses(String packageName) {
-          return getArray(allClasses, packageName);
-      }
+    /**
+     * Return all of the classes specified on the command-line that
+     * belong to the given package.
+     * @param packageName the name of the package specified on the
+     * command-line.
+     */
+    public ClassDoc[] allClasses(String packageName) {
+        return getArray(allClasses, packageName);
+    }
 
-     /**
-      * Return the array of package names that this catalog stores
-      * ClassDocs for.
-      */
-     public String[] packageNames() {
-         return packageSet.toArray(new String[] {});
-     }
+    /**
+     * Return the array of package names that this catalog stores
+     * ClassDocs for.
+     */
+    public String[] packageNames() {
+        return packageSet.toArray(new String[] {});
+    }
 
-     /**
-      * Return true if the given package is known to this catalog.
-      * @param packageName the name to check.
-      * @return true if this catalog has any information about
-      * classes in the given package.
-      */
-     public boolean isKnownPackage(String packageName) {
-         return packageSet.contains(packageName);
-     }
+    /**
+     * Return true if the given package is known to this catalog.
+     * @param packageName the name to check.
+     * @return true if this catalog has any information about
+     * classes in the given package.
+     */
+    public boolean isKnownPackage(String packageName) {
+        return packageSet.contains(packageName);
+    }
 
 
-      /**
-       * Return all of the errors specified on the command-line
-       * that belong to the given package.
-       * @param packageName the name of the package specified on the
-       * command-line.
-       */
-      public ClassDoc[] errors(String packageName) {
-          return getArray(errors, packageName);
-      }
+    /**
+     * Return all of the errors specified on the command-line
+     * that belong to the given package.
+     * @param packageName the name of the package specified on the
+     * command-line.
+     */
+    public ClassDoc[] errors(String packageName) {
+        return getArray(errors, packageName);
+    }
 
-      /**
-       * Return all of the exceptions specified on the command-line
-       * that belong to the given package.
-       * @param packageName the name of the package specified on the
-       * command-line.
-       */
-      public ClassDoc[] exceptions(String packageName) {
-          return getArray(exceptions, packageName);
-      }
+    /**
+     * Return all of the exceptions specified on the command-line
+     * that belong to the given package.
+     * @param packageName the name of the package specified on the
+     * command-line.
+     */
+    public ClassDoc[] exceptions(String packageName) {
+        return getArray(exceptions, packageName);
+    }
 
-      /**
-       * Return all of the enums specified on the command-line
-       * that belong to the given package.
-       * @param packageName the name of the package specified on the
-       * command-line.
-       */
-      public ClassDoc[] enums(String packageName) {
-          return getArray(enums, packageName);
-      }
+    /**
+     * Return all of the enums specified on the command-line
+     * that belong to the given package.
+     * @param packageName the name of the package specified on the
+     * command-line.
+     */
+    public ClassDoc[] enums(String packageName) {
+        return getArray(enums, packageName);
+    }
 
-      /**
-       * Return all of the annotation types specified on the command-line
-       * that belong to the given package.
-       * @param packageName the name of the package specified on the
-       * command-line.
-       */
-      public ClassDoc[] annotationTypes(String packageName) {
-          return getArray(annotationTypes, packageName);
-      }
+    /**
+     * Return all of the annotation types specified on the command-line
+     * that belong to the given package.
+     * @param packageName the name of the package specified on the
+     * command-line.
+     */
+    public ClassDoc[] annotationTypes(String packageName) {
+        return getArray(annotationTypes, packageName);
+    }
 
-      /**
-       * Return all of the interfaces specified on the command-line
-       * that belong to the given package.
-       * @param packageName the name of the package specified on the
-       * command-line.
-       */
-      public ClassDoc[] interfaces(String packageName) {
-          return getArray(interfaces, packageName);
-      }
+    /**
+     * Return all of the interfaces specified on the command-line
+     * that belong to the given package.
+     * @param packageName the name of the package specified on the
+     * command-line.
+     */
+    public ClassDoc[] interfaces(String packageName) {
+        return getArray(interfaces, packageName);
+    }
 
-      /**
-       * Return all of the ordinary classes specified on the command-line
-       * that belong to the given package.
-       * @param packageName the name of the package specified on the
-       * command-line.
-       */
-      public ClassDoc[] ordinaryClasses(String packageName) {
-          return getArray(ordinaryClasses, packageName);
-      }
+    /**
+     * Return all of the ordinary classes specified on the command-line
+     * that belong to the given package.
+     * @param packageName the name of the package specified on the
+     * command-line.
+     */
+    public ClassDoc[] ordinaryClasses(String packageName) {
+        return getArray(ordinaryClasses, packageName);
+    }
 }