Code example for HashSet

Methods: add, clear

0
     *  Delete all packages from list except the package indicated in info 
     */ 
    public void resetPackageList() { 
        pkgList.clear();
        pkgList.add(info.packageName);
    } 
     
    public String[] getPackageList() {
        int size = pkgList.size();
        if (size == 0) {
            return null; 
        } 
        String list[] = new String[size];
        pkgList.toArray(list);
        return list;
    } 
}