java.security
Class BasicPermissionCollection

java.lang.Object
  |
  +--java.security.PermissionCollection
        |
        +--java.security.BasicPermissionCollection
All Implemented Interfaces:
Serializable

final class BasicPermissionCollection
extends PermissionCollection
implements Serializable

A BasicPermissionCollection stores a collection of BasicPermission permissions. BasicPermission objects must be stored in a manner that allows them to be inserted in any order, but enable the implies function to evaluate the implies method in an efficient (and consistent) manner. A BasicPermissionCollection handles comparing a permission like "a.b.c.d.e" with a Permission such as "a.b.*", or "*".

Version:
1.33 02/01/02
Author:
Roland Schemers
See Also:
java.security.Permission, java.security.Permissions, java.security.PermissionsImpl, Serialized Form

Field Summary
private  boolean all_allowed
          This is set to true if this BasicPermissionCollection contains a BasicPermission with '*' as its permission name.
private  Class permClass
          The class to which all BasicPermissions in this BasicPermissionCollection belongs.
private  Hashtable permissions
          The BasicPermissions in this BasicPermissionCollection.
(package private) static long serialVersionUID
           
 
Fields inherited from class java.security.PermissionCollection
 
Constructor Summary
BasicPermissionCollection()
          Create an empty BasicPermissionCollection object.
 
Method Summary
 void add(Permission permission)
          Adds a permission to the BasicPermissions.
 Enumeration elements()
          Returns an enumeration of all the BasicPermission objects in the container.
 boolean implies(Permission permission)
          Check and see if this set of permissions implies the permissions expressed in "permission".
private  void readObject(ObjectInputStream s)
          readObject is called to restore the state of the BasicPermissionCollection from a stream.
 
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
 

Field Detail

serialVersionUID

static final long serialVersionUID

permissions

private Hashtable permissions
The BasicPermissions in this BasicPermissionCollection. All BasicPermissions in the collection must belong to the same class.


all_allowed

private boolean all_allowed
This is set to true if this BasicPermissionCollection contains a BasicPermission with '*' as its permission name.


permClass

private Class permClass
The class to which all BasicPermissions in this BasicPermissionCollection belongs.

Constructor Detail

BasicPermissionCollection

public BasicPermissionCollection()
Create an empty BasicPermissionCollection object.

Method Detail

add

public void add(Permission permission)
Adds a permission to the BasicPermissions. The key for the hash is permission.path.

Specified by:
add in class PermissionCollection
Parameters:
permission - the Permission object to add.

implies

public boolean implies(Permission permission)
Check and see if this set of permissions implies the permissions expressed in "permission".

Specified by:
implies in class PermissionCollection
Parameters:
permission - the Permission object to compare.
Returns:
true if "permission" is a proper subset of a permission in the set, false if not.

elements

public Enumeration elements()
Returns an enumeration of all the BasicPermission objects in the container.

Specified by:
elements in class PermissionCollection
Returns:
an enumeration of all the BasicPermission objects.

readObject

private void readObject(ObjectInputStream s)
                 throws IOException,
                        ClassNotFoundException
readObject is called to restore the state of the BasicPermissionCollection from a stream.

IOException
ClassNotFoundException


comments?