langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Group.java
author mcimadamore
Tue, 13 Jan 2009 13:27:14 +0000
changeset 1789 7ac8c0815000
parent 1475 19c0851667ca
child 5520 86e4b9a9da40
permissions -rw-r--r--
6765045: Remove rawtypes warnings from langtools Summary: Removed all occurrences of rawtypes warnings from langtools Reviewed-by: jjg, bpatel
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
/*
1264
076a3cde30d5 6754988: Update copyright year
xdono
parents: 868
diff changeset
     2
 * Copyright 1998-2008 Sun Microsystems, Inc.  All Rights Reserved.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
06bc494ca11e Initial load
duke
parents:
diff changeset
     4
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
06bc494ca11e Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
06bc494ca11e Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Sun designates this
06bc494ca11e Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
06bc494ca11e Initial load
duke
parents:
diff changeset
     9
 * by Sun in the LICENSE file that accompanied this code.
06bc494ca11e Initial load
duke
parents:
diff changeset
    10
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
06bc494ca11e Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
06bc494ca11e Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
06bc494ca11e Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
06bc494ca11e Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
06bc494ca11e Initial load
duke
parents:
diff changeset
    16
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
06bc494ca11e Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
06bc494ca11e Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
06bc494ca11e Initial load
duke
parents:
diff changeset
    20
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    21
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
06bc494ca11e Initial load
duke
parents:
diff changeset
    22
 * CA 95054 USA or visit www.sun.com if you need additional information or
06bc494ca11e Initial load
duke
parents:
diff changeset
    23
 * have any questions.
06bc494ca11e Initial load
duke
parents:
diff changeset
    24
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    25
06bc494ca11e Initial load
duke
parents:
diff changeset
    26
package com.sun.tools.doclets.internal.toolkit.util;
06bc494ca11e Initial load
duke
parents:
diff changeset
    27
06bc494ca11e Initial load
duke
parents:
diff changeset
    28
import com.sun.tools.doclets.internal.toolkit.*;
06bc494ca11e Initial load
duke
parents:
diff changeset
    29
import com.sun.javadoc.*;
06bc494ca11e Initial load
duke
parents:
diff changeset
    30
import java.util.*;
06bc494ca11e Initial load
duke
parents:
diff changeset
    31
06bc494ca11e Initial load
duke
parents:
diff changeset
    32
/**
06bc494ca11e Initial load
duke
parents:
diff changeset
    33
 * Process and manage grouping of packages, as specified by "-group" option on
06bc494ca11e Initial load
duke
parents:
diff changeset
    34
 * the command line.
06bc494ca11e Initial load
duke
parents:
diff changeset
    35
 * <p>
06bc494ca11e Initial load
duke
parents:
diff changeset
    36
 * For example, if user has used -group option as
06bc494ca11e Initial load
duke
parents:
diff changeset
    37
 * -group "Core Packages" "java.*" -group "CORBA Packages" "org.omg.*", then
06bc494ca11e Initial load
duke
parents:
diff changeset
    38
 * the packages specified on the command line will be grouped according to their
06bc494ca11e Initial load
duke
parents:
diff changeset
    39
 * names starting with either "java." or "org.omg.". All the other packages
06bc494ca11e Initial load
duke
parents:
diff changeset
    40
 * which do not fall in the user given groups, are grouped in default group,
06bc494ca11e Initial load
duke
parents:
diff changeset
    41
 * named as either "Other Packages" or "Packages" depending upon if "-group"
06bc494ca11e Initial load
duke
parents:
diff changeset
    42
 * option used or not at all used respectively.
06bc494ca11e Initial load
duke
parents:
diff changeset
    43
 * </p>
06bc494ca11e Initial load
duke
parents:
diff changeset
    44
 * <p>
06bc494ca11e Initial load
duke
parents:
diff changeset
    45
 * Also the packages are grouped according to the longest possible match of
06bc494ca11e Initial load
duke
parents:
diff changeset
    46
 * their names with the grouping information provided. For example, if there
06bc494ca11e Initial load
duke
parents:
diff changeset
    47
 * are two groups, like -group "Lang" "java.lang" and -group "Core" "java.*",
06bc494ca11e Initial load
duke
parents:
diff changeset
    48
 * will put the package java.lang in the group "Lang" and not in group "Core".
06bc494ca11e Initial load
duke
parents:
diff changeset
    49
 * </p>
06bc494ca11e Initial load
duke
parents:
diff changeset
    50
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    51
 * This code is not part of an API.
06bc494ca11e Initial load
duke
parents:
diff changeset
    52
 * It is implementation that is subject to change.
06bc494ca11e Initial load
duke
parents:
diff changeset
    53
 * Do not use it as an API
06bc494ca11e Initial load
duke
parents:
diff changeset
    54
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    55
 * @author Atul M Dambalkar
06bc494ca11e Initial load
duke
parents:
diff changeset
    56
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    57
public class Group {
06bc494ca11e Initial load
duke
parents:
diff changeset
    58
06bc494ca11e Initial load
duke
parents:
diff changeset
    59
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    60
     * Map of regular expressions with the corresponding group name.
06bc494ca11e Initial load
duke
parents:
diff changeset
    61
     */
868
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
    62
    private Map<String,String> regExpGroupMap = new HashMap<String,String>();
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    63
06bc494ca11e Initial load
duke
parents:
diff changeset
    64
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    65
     * List of regular expressions sorted according to the length. Regular
06bc494ca11e Initial load
duke
parents:
diff changeset
    66
     * expression with longest length will be first in the sorted order.
06bc494ca11e Initial load
duke
parents:
diff changeset
    67
     */
868
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
    68
    private List<String> sortedRegExpList = new ArrayList<String>();
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    69
06bc494ca11e Initial load
duke
parents:
diff changeset
    70
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    71
     * List of group names in the same order as given on the command line.
06bc494ca11e Initial load
duke
parents:
diff changeset
    72
     */
868
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
    73
    private List<String> groupList = new ArrayList<String>();
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    74
06bc494ca11e Initial load
duke
parents:
diff changeset
    75
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    76
     * Map of non-regular expressions(possible package names) with the
06bc494ca11e Initial load
duke
parents:
diff changeset
    77
     * corresponding group name.
06bc494ca11e Initial load
duke
parents:
diff changeset
    78
     */
868
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
    79
    private Map<String,String> pkgNameGroupMap = new HashMap<String,String>();
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    80
06bc494ca11e Initial load
duke
parents:
diff changeset
    81
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    82
     * The global configuration information for this run.
06bc494ca11e Initial load
duke
parents:
diff changeset
    83
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    84
    private final Configuration configuration;
06bc494ca11e Initial load
duke
parents:
diff changeset
    85
06bc494ca11e Initial load
duke
parents:
diff changeset
    86
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    87
     * Since we need to sort the keys in the reverse order(longest key first),
06bc494ca11e Initial load
duke
parents:
diff changeset
    88
     * the compare method in the implementing class is doing the reverse
06bc494ca11e Initial load
duke
parents:
diff changeset
    89
     * comparison.
06bc494ca11e Initial load
duke
parents:
diff changeset
    90
     */
868
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
    91
    private static class MapKeyComparator implements Comparator<String> {
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
    92
        public int compare(String key1, String key2) {
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
    93
            return key2.length() - key1.length();
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    94
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
    95
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    96
1475
19c0851667ca 6748541: javadoc should be reusable
jjg
parents: 1264
diff changeset
    97
    public Group(Configuration configuration) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    98
        this.configuration = configuration;
06bc494ca11e Initial load
duke
parents:
diff changeset
    99
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   100
06bc494ca11e Initial load
duke
parents:
diff changeset
   101
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   102
     * Depending upon the format of the package name provided in the "-group"
06bc494ca11e Initial load
duke
parents:
diff changeset
   103
     * option, generate two separate maps. There will be a map for mapping
06bc494ca11e Initial load
duke
parents:
diff changeset
   104
     * regular expression(only meta character allowed is '*' and that is at the
06bc494ca11e Initial load
duke
parents:
diff changeset
   105
     * end of the regular expression) on to the group name. And another map
06bc494ca11e Initial load
duke
parents:
diff changeset
   106
     * for mapping (possible) package names(if the name format doesen't contain
06bc494ca11e Initial load
duke
parents:
diff changeset
   107
     * meta character '*', then it is assumed to be a package name) on to the
06bc494ca11e Initial load
duke
parents:
diff changeset
   108
     * group name. This will also sort all the regular expressions found in the
06bc494ca11e Initial load
duke
parents:
diff changeset
   109
     * reverse order of their lengths, i.e. longest regular expression will be
06bc494ca11e Initial load
duke
parents:
diff changeset
   110
     * first in the sorted list.
06bc494ca11e Initial load
duke
parents:
diff changeset
   111
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   112
     * @param groupname       The name of the group from -group option.
06bc494ca11e Initial load
duke
parents:
diff changeset
   113
     * @param pkgNameFormList List of the package name formats.
06bc494ca11e Initial load
duke
parents:
diff changeset
   114
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   115
    public boolean checkPackageGroups(String groupname,
06bc494ca11e Initial load
duke
parents:
diff changeset
   116
            String pkgNameFormList) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   117
        StringTokenizer strtok = new StringTokenizer(pkgNameFormList, ":");
06bc494ca11e Initial load
duke
parents:
diff changeset
   118
        if (groupList.contains(groupname)) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   119
            configuration.message.warning("doclet.Groupname_already_used", groupname);
06bc494ca11e Initial load
duke
parents:
diff changeset
   120
            return false;
06bc494ca11e Initial load
duke
parents:
diff changeset
   121
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   122
        groupList.add(groupname);
06bc494ca11e Initial load
duke
parents:
diff changeset
   123
        while (strtok.hasMoreTokens()) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   124
            String id = strtok.nextToken();
06bc494ca11e Initial load
duke
parents:
diff changeset
   125
            if (id.length() == 0) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   126
                configuration.message.warning("doclet.Error_in_packagelist", groupname, pkgNameFormList);
06bc494ca11e Initial load
duke
parents:
diff changeset
   127
                return false;
06bc494ca11e Initial load
duke
parents:
diff changeset
   128
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   129
            if (id.endsWith("*")) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   130
                id = id.substring(0, id.length() - 1);
06bc494ca11e Initial load
duke
parents:
diff changeset
   131
                if (foundGroupFormat(regExpGroupMap, id)) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   132
                    return false;
06bc494ca11e Initial load
duke
parents:
diff changeset
   133
                }
06bc494ca11e Initial load
duke
parents:
diff changeset
   134
                regExpGroupMap.put(id, groupname);
06bc494ca11e Initial load
duke
parents:
diff changeset
   135
                sortedRegExpList.add(id);
06bc494ca11e Initial load
duke
parents:
diff changeset
   136
            } else {
06bc494ca11e Initial load
duke
parents:
diff changeset
   137
                if (foundGroupFormat(pkgNameGroupMap, id)) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   138
                    return false;
06bc494ca11e Initial load
duke
parents:
diff changeset
   139
                }
06bc494ca11e Initial load
duke
parents:
diff changeset
   140
                pkgNameGroupMap.put(id, groupname);
06bc494ca11e Initial load
duke
parents:
diff changeset
   141
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   142
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   143
        Collections.sort(sortedRegExpList, new MapKeyComparator());
06bc494ca11e Initial load
duke
parents:
diff changeset
   144
        return true;
06bc494ca11e Initial load
duke
parents:
diff changeset
   145
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   146
06bc494ca11e Initial load
duke
parents:
diff changeset
   147
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   148
     * Search if the given map has given the package format.
06bc494ca11e Initial load
duke
parents:
diff changeset
   149
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   150
     * @param map Map to be searched.
06bc494ca11e Initial load
duke
parents:
diff changeset
   151
     * @param pkgFormat The pacakge format to search.
06bc494ca11e Initial load
duke
parents:
diff changeset
   152
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   153
     * @return true if package name format found in the map, else false.
06bc494ca11e Initial load
duke
parents:
diff changeset
   154
     */
1789
7ac8c0815000 6765045: Remove rawtypes warnings from langtools
mcimadamore
parents: 1475
diff changeset
   155
    boolean foundGroupFormat(Map<String,?> map, String pkgFormat) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   156
        if (map.containsKey(pkgFormat)) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   157
            configuration.message.error("doclet.Same_package_name_used", pkgFormat);
06bc494ca11e Initial load
duke
parents:
diff changeset
   158
            return true;
06bc494ca11e Initial load
duke
parents:
diff changeset
   159
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   160
        return false;
06bc494ca11e Initial load
duke
parents:
diff changeset
   161
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   162
06bc494ca11e Initial load
duke
parents:
diff changeset
   163
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   164
     * Group the packages according the grouping information provided on the
06bc494ca11e Initial load
duke
parents:
diff changeset
   165
     * command line. Given a list of packages, search each package name in
06bc494ca11e Initial load
duke
parents:
diff changeset
   166
     * regular expression map as well as package name map to get the
06bc494ca11e Initial load
duke
parents:
diff changeset
   167
     * corresponding group name. Create another map with mapping of group name
06bc494ca11e Initial load
duke
parents:
diff changeset
   168
     * to the package list, which will fall under the specified group. If any
06bc494ca11e Initial load
duke
parents:
diff changeset
   169
     * package doesen't belong to any specified group on the comamnd line, then
06bc494ca11e Initial load
duke
parents:
diff changeset
   170
     * a new group named "Other Packages" will be created for it. If there are
06bc494ca11e Initial load
duke
parents:
diff changeset
   171
     * no groups found, in other words if "-group" option is not at all used,
06bc494ca11e Initial load
duke
parents:
diff changeset
   172
     * then all the packages will be grouped under group "Packages".
06bc494ca11e Initial load
duke
parents:
diff changeset
   173
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   174
     * @param packages Packages specified on the command line.
06bc494ca11e Initial load
duke
parents:
diff changeset
   175
     */
868
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
   176
    public Map<String,List<PackageDoc>> groupPackages(PackageDoc[] packages) {
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
   177
        Map<String,List<PackageDoc>> groupPackageMap = new HashMap<String,List<PackageDoc>>();
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   178
        String defaultGroupName =
06bc494ca11e Initial load
duke
parents:
diff changeset
   179
            (pkgNameGroupMap.isEmpty() && regExpGroupMap.isEmpty())?
06bc494ca11e Initial load
duke
parents:
diff changeset
   180
                configuration.message.getText("doclet.Packages") :
06bc494ca11e Initial load
duke
parents:
diff changeset
   181
                configuration.message.getText("doclet.Other_Packages");
06bc494ca11e Initial load
duke
parents:
diff changeset
   182
        // if the user has not used the default group name, add it
06bc494ca11e Initial load
duke
parents:
diff changeset
   183
        if (!groupList.contains(defaultGroupName)) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   184
            groupList.add(defaultGroupName);
06bc494ca11e Initial load
duke
parents:
diff changeset
   185
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   186
        for (int i = 0; i < packages.length; i++) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   187
            PackageDoc pkg = packages[i];
06bc494ca11e Initial load
duke
parents:
diff changeset
   188
            String pkgName = pkg.name();
868
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
   189
            String groupName = pkgNameGroupMap.get(pkgName);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   190
            // if this package is not explicitly assigned to a group,
06bc494ca11e Initial load
duke
parents:
diff changeset
   191
            // try matching it to group specified by regular expression
06bc494ca11e Initial load
duke
parents:
diff changeset
   192
            if (groupName == null) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   193
                groupName = regExpGroupName(pkgName);
06bc494ca11e Initial load
duke
parents:
diff changeset
   194
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   195
            // if it is in neither group map, put it in the default
06bc494ca11e Initial load
duke
parents:
diff changeset
   196
            // group
06bc494ca11e Initial load
duke
parents:
diff changeset
   197
            if (groupName == null) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   198
                groupName = defaultGroupName;
06bc494ca11e Initial load
duke
parents:
diff changeset
   199
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   200
            getPkgList(groupPackageMap, groupName).add(pkg);
06bc494ca11e Initial load
duke
parents:
diff changeset
   201
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   202
        return groupPackageMap;
06bc494ca11e Initial load
duke
parents:
diff changeset
   203
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   204
06bc494ca11e Initial load
duke
parents:
diff changeset
   205
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   206
     * Search for package name in the sorted regular expression
06bc494ca11e Initial load
duke
parents:
diff changeset
   207
     * list, if found return the group name.  If not, return null.
06bc494ca11e Initial load
duke
parents:
diff changeset
   208
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   209
     * @param pkgName Name of package to be found in the regular
06bc494ca11e Initial load
duke
parents:
diff changeset
   210
     * expression list.
06bc494ca11e Initial load
duke
parents:
diff changeset
   211
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   212
    String regExpGroupName(String pkgName) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   213
        for (int j = 0; j < sortedRegExpList.size(); j++) {
868
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
   214
            String regexp = sortedRegExpList.get(j);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   215
            if (pkgName.startsWith(regexp)) {
868
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
   216
                return regExpGroupMap.get(regexp);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   217
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   218
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   219
        return null;
06bc494ca11e Initial load
duke
parents:
diff changeset
   220
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   221
06bc494ca11e Initial load
duke
parents:
diff changeset
   222
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   223
     * For the given group name, return the package list, on which it is mapped.
06bc494ca11e Initial load
duke
parents:
diff changeset
   224
     * Create a new list, if not found.
06bc494ca11e Initial load
duke
parents:
diff changeset
   225
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   226
     * @param map Map to be searched for gorup name.
06bc494ca11e Initial load
duke
parents:
diff changeset
   227
     * @param groupname Group name to search.
06bc494ca11e Initial load
duke
parents:
diff changeset
   228
     */
868
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
   229
    List<PackageDoc> getPkgList(Map<String,List<PackageDoc>> map, String groupname) {
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
   230
        List<PackageDoc> list = map.get(groupname);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   231
        if (list == null) {
868
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
   232
            list = new ArrayList<PackageDoc>();
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   233
            map.put(groupname, list);
06bc494ca11e Initial load
duke
parents:
diff changeset
   234
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   235
        return list;
06bc494ca11e Initial load
duke
parents:
diff changeset
   236
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   237
06bc494ca11e Initial load
duke
parents:
diff changeset
   238
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   239
     * Return the list of groups, in the same order as specified
06bc494ca11e Initial load
duke
parents:
diff changeset
   240
     * on the command line.
06bc494ca11e Initial load
duke
parents:
diff changeset
   241
     */
1789
7ac8c0815000 6765045: Remove rawtypes warnings from langtools
mcimadamore
parents: 1475
diff changeset
   242
    public List<String> getGroupList() {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   243
        return groupList;
06bc494ca11e Initial load
duke
parents:
diff changeset
   244
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   245
}