javax.tv.service
Class ReadPermission

java.lang.Object
  extended by java.security.Permission
      extended by javax.tv.service.ReadPermission
All Implemented Interfaces:
Serializable, Guard

public final class ReadPermission
extends Permission
implements Serializable

This class represents permission to read the data referenced by a given Locator.

Version:
1.5, 08/28/00
See Also:
Serialized Form

Constructor Summary
ReadPermission(Locator locator)
          Creates a new ReadPermission object for the specified locator.
ReadPermission(String locator, String actions)
          Creates a new ReadPermission object for a locator with the given external form.
 
Method Summary
 boolean equals(Object other)
          Checks two ReadPermission objects for equality.
 String getActions()
          Returns the canonical string representation of the actions, which currently is the empty string "", since there are no actions for a ReadPermission.
 int hashCode()
          Returns the hash code value for this object.
 boolean implies(Permission p)
          Checks if this ReadPermission object "implies" the specified permission.
 
Methods inherited from class java.security.Permission
checkGuard, getName, newPermissionCollection, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ReadPermission

public ReadPermission(Locator locator)
Creates a new ReadPermission object for the specified locator.

Parameters:
locator - The locator. Null indicates permission for all locators.

ReadPermission

public ReadPermission(String locator,
                      String actions)
Creates a new ReadPermission object for a locator with the given external form. The actions string is currently unused and should be null. This constructor exists for use by the Policy object to instantiate new Permission objects.

Parameters:
locator - The external form of the locator. The string "*" indicates all locators.
actions - Should be null.
Method Detail

implies

public boolean implies(Permission p)
Checks if this ReadPermission object "implies" the specified permission.

More specificially, this method returns true if:

Specified by:
implies in class Permission
Parameters:
p - The permission to check against.
Returns:
true if the specified permission is implied by this object, false if not.

equals

public boolean equals(Object other)
Checks two ReadPermission objects for equality. Checks that other is a ReadPermission, and has the same locator as this object.

Specified by:
equals in class Permission
Parameters:
other - the object we are testing for equality with this object.
Returns:
true if other is of type ReadPermission and has the same locator as this ReadPermission object.
See Also:
Object.hashCode(), Hashtable

hashCode

public int hashCode()
Returns the hash code value for this object.

Specified by:
hashCode in class Permission
Returns:
A hash code value for this object.
See Also:
Object.equals(java.lang.Object), Hashtable

getActions

public String getActions()
Returns the canonical string representation of the actions, which currently is the empty string "", since there are no actions for a ReadPermission.

Specified by:
getActions in class Permission
Returns:
the empty string "".