Checks if this socket permission object "implies" the specified permission.
More specifically, this method first ensures that all of the following are true (and returns false if any of them are not):
- p is an instanceof SocketPermission,
- p's actions are a proper subset of this object's actions, and
- p's port range is included in this port range. Note: port range is ignored when p only contains the action, 'resolve'.
Then
implies
checks each of the following, in order, and for each returns true if the stated condition is true:
- If this object was initialized with a single IP address and one of p's IP addresses is equal to this object's IP address.
- If this object is a wildcard domain (such as *.sun.com), and p's canonical name (the name without any preceding *) ends with this object's canonical host name. For example, *.sun.com implies *.eng.sun.com..
- If this object was not initialized with a single IP address, and one of this object's IP addresses equals one of p's IP addresses.
- If this canonical name equals p's canonical name.
If none of the above are true,
implies
returns false.
@param p the permission to check against.
@return true if the specified permission is implied by this object,false if not.