/**
   * 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 && Util.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 = Util.getPackageName(pkg);
    Set<ClassDoc> s = map.get(key);
    if (s == null) {
      packageSet.add(key);
      s = new HashSet<ClassDoc>();
    }
    s.add(classdoc);
    map.put(key, s);
  }
 /**
  * Return all of the classes specified on the command-line that belong to the given package.
  *
  * @param packageDoc the package to return the classes for.
  */
 public ClassDoc[] allClasses(PackageDoc pkgDoc) {
   return pkgDoc.isIncluded()
       ? pkgDoc.allClasses()
       : getArray(allClasses, Util.getPackageName(pkgDoc));
 }