加载中...
The Wayback Machine - https://sup1a9wrlpyh5li9ro.vcoronado.top/web/20090326194437/http://developer.android.com:80/reference/java/security/BasicPermission.html
public abstract class

BasicPermission

extends Permission
implements Serializable
java.lang.Object
   ↳ java.security.Permission
     ↳ java.security.BasicPermission
Known Direct Subclasses

Class Overview

Superclass of permissions which have names but no action lists.

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.
[Expand]
Inherited Methods
From class java.security.Permission
From class java.lang.Object
From interface java.security.Guard

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