java.security
final class: AllPermissionCollection [javadoc |
source]
java.lang.Object
java.security.PermissionCollection
java.security.AllPermissionCollection
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
AllPermissionCollection
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.
Methods from java.lang.Object: |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method from java.security.AllPermissionCollection Detail: |
public void add(Permission permission) {
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;
}
Adds an {@code AllPermission} to the collection. |
public Enumeration<Permission> elements() {
return new SingletonEnumeration< Permission >(all);
}
Returns the enumeration of the collection. |
public boolean implies(Permission permission) {
return all != null;
}
Indicates whether the argument permission is implied by the receiver.
{@code AllPermission} objects imply all other permissions. |