java.security
Class Permissions

java.lang.Object
  extended by java.security.PermissionCollection
      extended by java.security.Permissions
All Implemented Interfaces:
Serializable

public final class Permissions
extends PermissionCollection
implements Serializable

This class is a heterogeneous collection of permissions. It is organized as a collection of PermissionCollection's stored in a hashtable. Each individual PermissionCollection contains permissions of a single type. If a specific type of Permission does not provide a collection type to use via its newPermissionCollection method, then a default collection type which stores its permissions in a hash table will be used.

Since:
1.1
See Also:
Serialized Form

Constructor Summary
Permissions()
          This method initializes a new instance of Permissions.
 
Method Summary
 void add(Permission perm)
          This method adds a new Permission to this collection.
 Enumeration<Permission> elements()
          This method returns an Enumeration which contains a list of all Permission objects contained in this collection.
 boolean implies(Permission perm)
          This method tests whether or not the specified Permission is implied by this PermissionCollection.
 
Methods inherited from class java.security.PermissionCollection
isReadOnly, setReadOnly, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Permissions

public Permissions()
This method initializes a new instance of Permissions.

Method Detail

add

public void add(Permission perm)
This method adds a new Permission to this collection. It will be stored in a PermissionCollection of the appropriate type, as determined by calling newPermissionCollection on the specified permission (if an appropriate collection does not already exist). If this object does not specify a particular type of collection, a default collection, which stores in permissions in a hash table, will be used.

Specified by:
add in class PermissionCollection
Parameters:
perm - the Permission to add
Throws:
SecurityException - if this collection is marked as read only

implies

public boolean implies(Permission perm)
This method tests whether or not the specified Permission is implied by this PermissionCollection.

Specified by:
implies in class PermissionCollection
Parameters:
perm - the Permission to test
Returns:
true if the specified permission is implied by this

elements

public Enumeration<Permission> elements()
This method returns an Enumeration which contains a list of all Permission objects contained in this collection.

Specified by:
elements in class PermissionCollection
Returns:
an Enumeration of this collection's elements