FileDocCategorySizeDatePackage
AllPermissionCollection.javaAPI DocAndroid 1.5 API4536Wed May 06 22:41:04 BST 2009java.security

AllPermissionCollection

public final class AllPermissionCollection extends PermissionCollection
Specific {@code PermissionCollection} for storing {@code AllPermission}s. All instances of {@code AllPermission} are equivalent, so it is enough to store a single added instance.
see
AllPermission
since
Android 1.0

Fields Summary
private static final long
serialVersionUID
private static final ObjectStreamField[]
serialPersistentFields
private transient Permission
all
Constructors Summary
Methods Summary
public voidadd(java.security.Permission permission)
Adds an {@code AllPermission} to the collection.


                
        
        if (isReadOnly()) {
            throw new SecurityException(Messages.getString("security.15")); //$NON-NLS-1$
        }
        if (!(permission instanceof AllPermission)) {
            throw new IllegalArgumentException(Messages.getString("security.16", //$NON-NLS-1$
                permission));
        }
        all = permission;
    
public java.util.Enumerationelements()
Returns the enumeration of the collection.

        return new SingletonEnumeration<Permission>(all);
    
public booleanimplies(java.security.Permission permission)
Indicates whether the argument permission is implied by the receiver. {@code AllPermission} objects imply all other permissions.

return
boolean {@code true} if the argument permission is implied by the receiver, and {@code false} if it is not.
param
permission the permission to check.

        return all != null;
    
private voidreadObject(java.io.ObjectInputStream in)
Restores internal state.

        ObjectInputStream.GetField fields = in.readFields();
        if (fields.get("all_allowed", false)) { //$NON-NLS-1$
            all = new AllPermission();
        }
    
private voidwriteObject(java.io.ObjectOutputStream out)
Writes the fields according to expected format, adding the boolean field {@code all_allowed} which is {@code true} if this collection is not empty.

        ObjectOutputStream.PutField fields = out.putFields();
        fields.put("all_allowed", all != null); //$NON-NLS-1$
        out.writeFields();