Agent System POND 1.2 (28.2.2002)

PkgAgentSystem
Class ValuedPermissions

java.lang.Object
  |
  +--java.security.PermissionCollection
        |
        +--PkgAgentSystem.DynamicPermissions
              |
              +--PkgAgentSystem.ValuedPermissions
All Implemented Interfaces:
Serializable

public class ValuedPermissions
extends DynamicPermissions

A collection of permissions which are asociated with a value. Used here as price.

Version:
1.0, 1.7.2000
Author:
Michael Sonntag
See Also:
Serialized Form

Fields inherited from class PkgAgentSystem.DynamicPermissions
allPermission, perms
 
Constructor Summary
ValuedPermissions()
          Create a new and empty object
 
Method Summary
 void add(Permission permission)
          Adds a new permission object.
 void add(Permission permission, double value)
          Adds a new permission object and the associated value.
(package private)  DynamicPermissions copy()
          Returns a copy of this object.
 double getValue(Permission permission)
          Returns the value associated with a permission
 void remove(Permission permission)
          Removes a permission object and also the associated value.
 void removeAll()
          Removes all permissions.
 
Methods inherited from class PkgAgentSystem.DynamicPermissions
elements, getPermissionCollection, implies, setReadOnly
 
Methods inherited from class java.security.PermissionCollection
isReadOnly, toString
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ValuedPermissions

public ValuedPermissions()
Create a new and empty object
Method Detail

add

public void add(Permission permission)
Adds a new permission object. Should not be called (if called, adds it with infinite value).
Overrides:
add in class DynamicPermissions
Parameters:
permission - the permission to add

getValue

public double getValue(Permission permission)
Returns the value associated with a permission
Parameters:
permission - the permission to get the value for
Returns:
the value for this permission or infinity if the permission is not contained in this collection

add

public void add(Permission permission,
                double value)
Adds a new permission object and the associated value.
Parameters:
permission - the Permission object to add.
value - the value of this permission

remove

public void remove(Permission permission)
Removes a permission object and also the associated value.
Overrides:
remove in class DynamicPermissions
Parameters:
permission - the Permission object to add.
value - the value of this permission

removeAll

public void removeAll()
Removes all permissions.
Overrides:
removeAll in class DynamicPermissions
Throws:
SecurityException - if the caller has not RuntimePermission("revokePermissions")

copy

DynamicPermissions copy()
Returns a copy of this object. Package access for safety.
Overrides:
copy in class DynamicPermissions
Returns:
a DynamicPermissions object containing the same permissions as this one

Agent System POND 1.2 (28.2.2002)

Submit a bug

Copyright 2001,2002 Michael Sonntag & Institute for Information Processing and Microprocessor Technology (FIM), Johannes-Kepler-University Linz, Altenbergerstr. 69, A-4040 Linz, Austria.