/**
  * Add the members into a single list of deprecated members.
  *
  * @param list List of all the particular deprecated members, e.g. methods.
  * @param members members to be added in the list.
  */
 private void composeDeprecatedList(List<Doc> list, MemberDoc[] members) {
   for (int i = 0; i < members.length; i++) {
     if (Util.isDeprecated(members[i])) {
       list.add(members[i]);
     }
   }
 }
 /**
  * Build the sorted list of all the deprecated APIs in this run. Build separate lists for
  * deprecated packages, classes, constructors, methods and fields.
  *
  * @param configuration the current configuration of the doclet.
  */
 private void buildDeprecatedAPIInfo(Configuration configuration) {
   PackageDoc[] packages = configuration.packages;
   PackageDoc pkg;
   for (int c = 0; c < packages.length; c++) {
     pkg = packages[c];
     if (Util.isDeprecated(pkg)) {
       getList(PACKAGE).add(pkg);
     }
   }
   ClassDoc[] classes = configuration.root.classes();
   for (int i = 0; i < classes.length; i++) {
     ClassDoc cd = classes[i];
     if (Util.isDeprecated(cd)) {
       if (cd.isOrdinaryClass()) {
         getList(CLASS).add(cd);
       } else if (cd.isInterface()) {
         getList(INTERFACE).add(cd);
       } else if (cd.isException()) {
         getList(EXCEPTION).add(cd);
       } else if (cd.isEnum()) {
         getList(ENUM).add(cd);
       } else if (cd.isError()) {
         getList(ERROR).add(cd);
       } else if (cd.isAnnotationType()) {
         getList(ANNOTATION_TYPE).add(cd);
       }
     }
     composeDeprecatedList(getList(FIELD), cd.fields());
     composeDeprecatedList(getList(METHOD), cd.methods());
     composeDeprecatedList(getList(CONSTRUCTOR), cd.constructors());
     if (cd.isEnum()) {
       composeDeprecatedList(getList(ENUM_CONSTANT), cd.enumConstants());
     }
     if (cd.isAnnotationType()) {
       composeDeprecatedList(getList(ANNOTATION_TYPE_MEMBER), ((AnnotationTypeDoc) cd).elements());
     }
   }
   sortDeprecatedLists();
 }
  /**
   * 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);
  }