Code example for HashSet

Methods: add, contains

0
     *  Return true if package has been added false if not 
     */ 
    public boolean addPackage(String pkg) {
        if (!pkgList.contains(pkg)) {
            pkgList.add(pkg);
            return true; 
        } 
        return false; 
    } 
     
    /* 
     *  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) {