langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/IndexBuilder.java
changeset 22163 3651128c74eb
parent 22159 682da512ec17
child 24220 eb213562268d
equal deleted inserted replaced
22162:3b3e23e67329 22163:3651128c74eb
    49 
    49 
    50     /**
    50     /**
    51      * Mapping of each Unicode Character with the member list containing
    51      * Mapping of each Unicode Character with the member list containing
    52      * members with names starting with it.
    52      * members with names starting with it.
    53      */
    53      */
    54     private Map<Character,List<Doc>> indexmap = new HashMap<Character,List<Doc>>();
    54     private Map<Character,List<Doc>> indexmap = new HashMap<>();
    55 
    55 
    56     /**
    56     /**
    57      * Don't generate deprecated information if true.
    57      * Don't generate deprecated information if true.
    58      */
    58      */
    59     private boolean noDeprecated;
    59     private boolean noDeprecated;
   147     protected void buildIndexMap(RootDoc root)  {
   147     protected void buildIndexMap(RootDoc root)  {
   148         PackageDoc[] packages = root.specifiedPackages();
   148         PackageDoc[] packages = root.specifiedPackages();
   149         ClassDoc[] classes = root.classes();
   149         ClassDoc[] classes = root.classes();
   150         if (!classesOnly) {
   150         if (!classesOnly) {
   151             if (packages.length == 0) {
   151             if (packages.length == 0) {
   152                 Set<PackageDoc> set = new HashSet<PackageDoc>();
   152                 Set<PackageDoc> set = new HashSet<>();
   153                 for (ClassDoc aClass : classes) {
   153                 for (ClassDoc aClass : classes) {
   154                     PackageDoc pd = aClass.containingPackage();
   154                     PackageDoc pd = aClass.containingPackage();
   155                     if (pd != null && pd.name().length() > 0) {
   155                     if (pd != null && pd.name().length() > 0) {
   156                         set.add(pd);
   156                         set.add(pd);
   157                     }
   157                     }
   200                           '*' :
   200                           '*' :
   201                           Character.toUpperCase(name.charAt(0));
   201                           Character.toUpperCase(name.charAt(0));
   202                 Character unicode = ch;
   202                 Character unicode = ch;
   203                 List<Doc> list = indexmap.get(unicode);
   203                 List<Doc> list = indexmap.get(unicode);
   204                 if (list == null) {
   204                 if (list == null) {
   205                     list = new ArrayList<Doc>();
   205                     list = new ArrayList<>();
   206                     indexmap.put(unicode, list);
   206                     indexmap.put(unicode, list);
   207                 }
   207                 }
   208                 list.add(element);
   208                 list.add(element);
   209             }
   209             }
   210         }
   210         }