Android
java.security
public abstract class

java.security.BasicPermission

java.lang.Object
java.security.Permission Serializable Guard
java.security.BasicPermission Serializable

Superclass of permissions which have names but no action lists.

Known Direct Subclasses

Summary

Public Constructors

            BasicPermission(String name)
Creates an instance of this class with the given name and action list.
            BasicPermission(String name, String action)
Creates an instance of this class with the given name and action list.

Public Methods

          boolean  equals(Object obj)
Compares the argument to the receiver, and returns true if they represent the same object using a class specific comparison.
          String  getActions()
Returns the actions associated with the receiver.
          int  hashCode()
Returns an integer hash code for the receiver.
          boolean  implies(Permission permission)
Indicates whether the argument permission is implied by the receiver.
          PermissionCollection  newPermissionCollection()
Returns a new PermissionCollection for holding permissions of this class.
Methods inherited from class java.security.Permission
Methods inherited from class java.lang.Object
Methods inherited from interface java.security.Guard

Details

Public Constructors

public BasicPermission(String name)

Creates an instance of this class with the given name and action list.

Parameters

name String the name of the new permission.

public BasicPermission(String name, String action)

Creates an instance of this class with the given name and action list. The action list is ignored.

Parameters

name String the name of the new permission.
action String ignored.

Public Methods

public boolean equals(Object obj)

Compares the argument to the receiver, and returns true if they represent the same object using a class specific comparison. In this case, the receiver and the object must have the same class and name.

Parameters

obj the object to compare with this object

Returns

  • true if the object is the same as this object false if it is different from this object

See Also

public String getActions()

Returns the actions associated with the receiver. BasicPermission objects have no actions, so answer the empty string.

Returns

  • String the actions associated with the receiver.

public int hashCode()

Returns an integer hash code for the receiver. Any two objects which answer true when passed to equals must answer the same value for this method.

Returns

  • int the receiver's hash

See Also

public boolean implies(Permission permission)

Indicates whether the argument permission is implied by the receiver.

Parameters

permission java.security.Permission the permission to check

Returns

  • boolean true if the argument permission is implied by the receiver, and false if it is not.

public PermissionCollection newPermissionCollection()

Returns a new PermissionCollection for holding permissions of this class. Answer null if any permission collection can be used.

Note: For BasicPermission (and subclasses which do not override this method), the collection which is returned does not invoke the .implies method of the permissions which are stored in it when checking if the collection implies a permission. Instead, it assumes that if the type of the permission is correct, and the name of the permission is correct, there is a match.

Returns

  • a new PermissionCollection or null

See Also

  • BasicPermissionCollection
Copyright 2007 Google Inc. Build 0.9_r1-98467 - 14 Aug 2008 18:56