Agent System POND 1.0 (1.7.2000)

PkgAgentSystem
Class ValuedPermissions

java.lang.Object
  |
  +--java.security.PermissionCollection
        |
        +--PkgAgentSystem.DynamicPermissions
              |
              +--PkgAgentSystem.ValuedPermissions

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).
Parameters:
permission - the permission to add
Overrides:
add in class DynamicPermissions

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.
Parameters:
permission - the Permission object to add.
value - the value of this permission
Overrides:
remove in class DynamicPermissions

removeAll

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

copy

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

Agent System POND 1.0 (1.7.2000)

Submit a bug

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