FileDocCategorySizeDatePackage
PermissionsHash.javaAPI DocAndroid 1.5 API2834Wed May 06 22:41:06 BST 2009java.security

PermissionsHash

public final class PermissionsHash extends PermissionCollection
A default {@code PermissionCollection} implementation that uses a hashtable. Each hashtable entry stores a Permission object as both the key and the value.
This {@code PermissionCollection} is intended for storing "neutral" permissions which do not require special collection.
since
Android 1.0

Fields Summary
private static final long
serialVersionUID
private final Hashtable
perms
Constructors Summary
Methods Summary
public voidadd(java.security.Permission permission)
Adds the argument to the collection.

param
permission the permission to add to the collection.


                                    
        
        perms.put(permission, permission);
    
public java.util.Enumerationelements()
Returns an enumeration of the permissions in the receiver.

return
Enumeration the permissions in the receiver.

        return perms.elements();
    
public booleanimplies(java.security.Permission permission)
Indicates whether the argument permission is implied by the permissions contained in the receiver.

return
boolean true if the argument permission is implied by the permissions in the receiver, and false if it is not.
param
permission java.security.Permission the permission to check

        for (Enumeration elements = elements(); elements.hasMoreElements();) {
            if (((Permission)elements.nextElement()).implies(permission)) {
                return true;
            }
        }
        return false;