public final class CommProtocolPermission extends GCFPermission
CommProtocolPermission
consists of a URI string but no
actions list.
The URI string specifies a logical serial port connection and optional parameters. It takes the following form:
comm:{port identifier}[{optional parameters}]An asterisk may appear at the end of the URI string to indicate a wildcard match in the port identifer field. Valid examples include "comm:*" and "comm:port*".
Connector.open(java.lang.String)
,
"javax.microedition.io.CommConnection" in MIDP 3.0 SpecificationConstructor and Description |
---|
CommProtocolPermission(String uri)
Creates a new
CommProtocolPermission with the specified
URI as its name. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj)
Checks two
CommProtocolPermission objects for equality. |
String |
getActions()
Returns the canonical string representation of the actions, which
currently is the empty string "", since there are no actions defined
for
CommProtocolPermission . |
int |
hashCode()
Returns the hash code value for this object.
|
boolean |
implies(Permission p)
Checks if this
CommProtocolPermission object "implies"
the specified permission. |
PermissionCollection |
newPermissionCollection()
Returns a new
PermissionCollection for storing
CommProtocolPermission objects. |
getProtocol, getURI
getName, toString
public CommProtocolPermission(String uri)
CommProtocolPermission
with the specified
URI as its name. The URI string must conform to the specification
given above.uri
- the URI string.IllegalArgumentException
- if uri
is malformed.NullPointerException
- if uri
is null
.Permission.getName()
public boolean implies(Permission p)
CommProtocolPermission
object "implies"
the specified permission.
More specifically, this method returns true
if:
CommProtocolPermission
, and
implies
in class Permission
p
- the permission to check againstpublic boolean equals(Object obj)
CommProtocolPermission
objects for equality.equals
in class Permission
obj
- the object we are testing for equality with this object.true
if obj
is a
CommProtocolPermission
and has the same URI string as
this CommProtocolPermission
object.Boolean.hashCode()
,
Hashtable
public int hashCode()
hashCode
in class Permission
Object.equals(java.lang.Object)
,
Hashtable
public String getActions()
CommProtocolPermission
.getActions
in class Permission
public PermissionCollection newPermissionCollection()
PermissionCollection
for storing
CommProtocolPermission
objects.
CommProtocolPermission
objects must be stored in a
manner that allows
them to be inserted into the collection in any order, but that also
enables the PermissionCollection
implies method to be
implemented in an efficient (and consistent) manner.
newPermissionCollection
in class Permission
PermissionCollection
suitable for storing
CommProtocolPermission
objects.