java.net.SocketPermission翻译

类别:Java 点击:0 评论:0 推荐:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.4.2-rc) on Fri Jun 13 00:14:24 PDT 2003 -->
<TITLE>
SocketPermission (Java 2 Platform SE v1.4.2)
</TITLE>

<META NAME="keywords" CONTENT="java.net.SocketPermission class">
<META NAME="keywords" CONTENT="implies()">
<META NAME="keywords" CONTENT="equals()">
<META NAME="keywords" CONTENT="hashCode()">
<META NAME="keywords" CONTENT="getActions()">
<META NAME="keywords" CONTENT="newPermissionCollection()">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style">

<SCRIPT type="text/javascript">
function windowTitle()
{
    parent.document.title="SocketPermission (Java 2 Platform SE v1.4.2)";
}
</SCRIPT>

</HEAD>

<BODY BGCOLOR="white" onload="windowTitle();">


<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/SocketPermission.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
<b>Java<sup><font size=-2>TM</font></sup>&nbsp;2&nbsp;Platform<br>Std.&nbsp;Ed. v1.4.2</b></EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../java/net/SocketImpl.html" title="class in java.net"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../java/net/URI.html" title="class in java.net"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../index.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="SocketPermission.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>

</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->

<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
java.net</FONT>
<BR>
Class SocketPermission</H2>
<PRE>
<A HREF="../../java/lang/Object.html" title="class in java.lang">java.lang.Object</A>
  <IMG SRC="../../resources/inherit.gif" ALT="extended by"><A HREF="../../java/security/Permission.html" title="class in java.security">java.security.Permission</A>
      <IMG SRC="../../resources/inherit.gif" ALT="extended by"><B>java.net.SocketPermission</B>
</PRE>
<DL>
<DT><B>All Implemented Interfaces:</B> <DD><A HREF="../../java/security/Guard.html" title="interface in java.security">Guard</A>, <A HREF="../../java/io/Serializable.html" title="interface in java.io">Serializable</A></DD>
</DL>
<HR>
<DL>
<DT>public final class <B>SocketPermission</B><DT>extends <A HREF="../../java/security/Permission.html" title="class in java.security">Permission</A><DT>implements <A HREF="../../java/io/Serializable.html" title="interface in java.io">Serializable</A></DL>

<P>
This class represents access to a network via sockets.
 A SocketPermission consists of a
 host specification and a set of "actions" specifying ways to
 connect to that host. The host is specified as
 该类表示通过套接字对网络的访问。一个SocketPermission由一个主机详细说明和连接这个主机的具体方式的一系列“动作”组成。
 主机具体如下
 <pre>
    host = (hostname | IPv4address | iPv6reference) [:portrange]
    portrange = portnumber | -portnumber | portnumber-[portnumber]
 </pre>
 The host is expressed as a DNS name, as a numerical IP address,
 or as "localhost" (for the local machine).
 The wildcard "*" may be included once in a DNS name host
 specification. If it is included, it must be in the leftmost
 position, as in "*.sun.com".
 朱基被表示为一个DNS名称,一个数字的IP地址,或“localhost”(表示本地主机)。在DNS名称说明中可以包括
 通配符“*”。如果包括,则必须位于最左侧,例如“*.sun.com”。
 <p>
 The format of the IPv6reference should follow that specified in <a
 href="http://www.ietf.org/rfc/rfc2732.txt"><i>RFC&nbsp;2732: Format
 for Literal IPv6 Addresses in URLs</i></a>:
IPv6reference格式应遵循RFC2732:Format for Literal IPv6 Addresses in URLs:
 <pre>
    ipv6reference = "[" IPv6address "]"
</pre>
 For example, you can construct a SocketPermission instance
 as the following:
 例如,你可以按以下方式构造SocketPermission实例:
 <pre>
    String hostAddress = inetaddress.getHostAddress();
    if (inetaddress instanceof Inet6Address) {
        sp = new SocketPermission("[" + hostAddress + "]:" + port, action);
    } else {
        sp = new SocketPermission(hostAddress + ":" + port, action);
    }
 </pre>
 or 或者
 <pre>
    String host = url.getHost();
    sp = new SocketPermission(host + ":" + port, action);
 </pre>
 <p>
 The <A HREF="Inet6Address.html#lform">full uncompressed form</A> of
 an IPv6 literal address is also valid.
 IPv6地址完整未压缩的文字形式也有效。
 <p>
 The port or portrange is optional. A port specification of the
 form "N-", where <i>N</i> is a port number, signifies all ports
 numbered <i>N</i> and above, while a specification of the
 form "-N" indicates all ports numbered <i>N</i> and below.
 端口和端口范围可选。“N-”形式的端口说明N是端口号,表示N和N以上大小的所有端口,
 而“-N”形式的端口说明N是端口号,表示N和N以下大小的所有端口,
  <p>
 The possible ways to connect to the host are
 连接到主机的可能方式有
 <pre>
 accept
 connect
 listen
 resolve
 </pre>
 The "listen" action is only meaningful when used with "localhost".
 The "resolve" action is implied when any of the other actions are present.
 The action "resolve" refers to host/ip name service lookups.
 “listen”只有同“localhost”一起使用才有意义。在给出任何其他动作时,resolve(解析主机名或IP命名服务查询)
 都是默认的。
 <p>As an example of the creation and meaning of SocketPermissions, 
 note that if the following permission:
 举例给出SocketPermissions的创建和意思,注意如果以下许可
 <pre>
   p1 = new SocketPermission("puffin.eng.sun.com:7777", "connect,accept");
 </pre>
 
 is granted to some code, it allows that code to connect to port 7777 on
 <code>puffin.eng.sun.com</code>, and to accept connections on that port.
 被授权给某些代码,则允许代码连接puffin.eng.sun.com的端口7777,接收此端口的连接。
 <p>Similarly, if the following permission:
 同样,如果以下许可
 <pre>
   p1 = new SocketPermission("puffin.eng.sun.com:7777", "connect,accept");
   p2 = new SocketPermission("localhost:1024-", "accept,connect,listen");
 </pre>
 
 is granted to some code, it allows that code to
 accept connections on, connect to, or listen on any port between
 1024 and 65535 on the local host.
被授权给某些代码,则允许代码接收连接、连接或者监听端口号在1024和65535之间的本地主机。
 <p>Note: Granting code permission to accept or make connections to remote
 hosts may be dangerous because malevolent code can then more easily
 transfer and share confidential data among parties who may not
 otherwise have access to the data.
 注意:授权代码接收或发起到远端主机的连接可能有一定的威胁,因为恶意代码可能更容易地传输和分享两端之间原本不可访问的秘密数据。
<P>

<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../java/security/Permissions.html" title="class in java.security"><CODE>Permissions</CODE></A>,
<A HREF="../../java/net/SocketPermission.html" title="class in java.net"><CODE>SocketPermission</CODE></A></DL>
<HR>

<P>
<!-- ======== NESTED CLASS SUMMARY ======== -->


<!-- =========== FIELD SUMMARY =========== -->


<!-- ======== CONSTRUCTOR SUMMARY ======== -->

<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../java/net/SocketPermission.html#SocketPermission(java.lang.String, java.lang.String)">SocketPermission</A></B>(<A HREF="../../java/lang/String.html" title="class in java.lang">String</A>&nbsp;host,
                 <A HREF="../../java/lang/String.html" title="class in java.lang">String</A>&nbsp;action)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a new SocketPermission object with the specified actions.
创建一个指定动作的SocketPermission。</TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== METHOD SUMMARY =========== -->

<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Method Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/net/SocketPermission.html#equals(java.lang.Object)">equals</A></B>(<A HREF="../../java/lang/Object.html" title="class in java.lang">Object</A>&nbsp;obj)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Checks two SocketPermission objects for equality.
检查两个SocketPermission对象是否相等。</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../java/lang/String.html" title="class in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/net/SocketPermission.html#getActions()">getActions</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the canonical string representation of the actions.
返回动作的符合规定的字符串形式。</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/net/SocketPermission.html#hashCode()">hashCode</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the hash code value for this object.
返回此对象的hash码值。</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/net/SocketPermission.html#implies(java.security.Permission)">implies</A></B>(<A HREF="../../java/security/Permission.html" title="class in java.security">Permission</A>&nbsp;p)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Checks if this socket permission object "implies" the
 specified permission.
 检查此套接字许可对象是否隐含有指定的许可。</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../java/security/PermissionCollection.html" title="class in java.security">PermissionCollection</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/net/SocketPermission.html#newPermissionCollection()">newPermissionCollection</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a new PermissionCollection object for storing SocketPermission
 objects.
 返回一个新的存储SocketPermission的PermissionCollection。</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.security.Permission"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Methods inherited from class java.security.<A HREF="../../java/security/Permission.html" title="class in java.security">Permission</A></B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../java/security/Permission.html#checkGuard(java.lang.Object)">checkGuard</A>, <A HREF="../../java/security/Permission.html#getName()">getName</A>, <A HREF="../../java/security/Permission.html#toString()">toString</A></CODE></TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Methods inherited from class java.lang.<A HREF="../../java/lang/Object.html" title="class in java.lang">Object</A></B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../java/lang/Object.html#clone()">clone</A>, <A HREF="../../java/lang/Object.html#finalize()">finalize</A>, <A HREF="../../java/lang/Object.html#getClass()">getClass</A>, <A HREF="../../java/lang/Object.html#notify()">notify</A>, <A HREF="../../java/lang/Object.html#notifyAll()">notifyAll</A>, <A HREF="../../java/lang/Object.html#wait()">wait</A>, <A HREF="../../java/lang/Object.html#wait(long)">wait</A>, <A HREF="../../java/lang/Object.html#wait(long, int)">wait</A></CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>

<!-- ============ FIELD DETAIL =========== -->


<!-- ========= CONSTRUCTOR DETAIL ======== -->

<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TD>
</TR>
</TABLE>

<A NAME="SocketPermission(java.lang.String, java.lang.String)"><!-- --></A><H3>
SocketPermission</H3>
<PRE>
public <B>SocketPermission</B>(<A HREF="../../java/lang/String.html" title="class in java.lang">String</A>&nbsp;host,
                        <A HREF="../../java/lang/String.html" title="class in java.lang">String</A>&nbsp;action)</PRE>
<DL>
<DD>Creates a new SocketPermission object with the specified actions.
 The host is expressed as a DNS name, or as a numerical IP address.
 Optionally, a port or a portrange may be supplied (separated
 from the DNS name or IP address by a colon).
 创建一个指定动作的SocketPermission。主机被表示为一个DNS名称,一个数字的IP地址。还可以提供一个端口或端口范围(用
 冒号将DNS名称或IP地址分开)。
 <p>
 To specify the local machine, use "localhost" as the <i>host</i>.
 Also note: An empty <i>host</i> String ("") is equivalent to "localhost".
 要指定本地机器,可以使用“localhost”作为host参数。同时空的host字符串“”也等同于“localhost”。
 <p>
 The <i>actions</i> parameter contains a comma-separated list of the
 actions granted for the specified host (and port(s)). Possible actions are
 "connect", "listen", "accept", "resolve", or
 any combination of those. "resolve" is automatically added
 when any of the other three are specified.
 actions参数包括一个以逗号分隔的动作列表,授权给指定的主机(和端口)。可能的动作包括:connect、listen、
 accept、resolve或者它们之间的组合。当指定其他三种动作时,resolve是自动添加的。
 <p>
 Examples of SocketPermission instantiation are the following:
 SocketPermission实例化的例子如下:
 <pre>
    nr = new SocketPermission("www.catalog.com", "connect");
    nr = new SocketPermission("www.sun.com:80", "connect");
    nr = new SocketPermission("*.sun.com", "connect");
    nr = new SocketPermission("*.edu", "resolve");
    nr = new SocketPermission("204.160.241.0", "connect");
    nr = new SocketPermission("localhost:1024-65535", "listen");
    nr = new SocketPermission("204.160.241.0:1024-65535", "connect");
 </pre>
<P>
<DT><B>Parameters:</B><DD><CODE>host</CODE> - the hostname or IPaddress of the computer, optionally
 including a colon followed by a port or port range. 主机名或计算机的IP地址,也可以包括冒号,后加上端口或端口范围。<DD><CODE>action</CODE> - the action string.
 动作字符串。
 </DL>

<!-- ============ METHOD DETAIL ========== -->

<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Method Detail</B></FONT></TD>
</TR>
</TABLE>

<A NAME="implies(java.security.Permission)"><!-- --></A><H3>
implies</H3>
<PRE>
public boolean <B>implies</B>(<A HREF="../../java/security/Permission.html" title="class in java.security">Permission</A>&nbsp;p)</PRE>
<DL>
<DD>Checks if this socket permission object "implies" the
 specified permission.
 检查此套接字许可对象是否隐含有指定的许可。
 <P>
 More specifically, this method first ensures that all of the following
 are true (and returns false if any of them are not):
 尤其特别地,该方法首先要保证下列条件为true(如果任何一个不满足返回false):<p>
 <ul>
 <li> <i>p</i> is an instanceof SocketPermission,
 p是SocketPermission的实例<p>
 <li> <i>p</i>'s actions are a proper subset of this
 object's actions, and
 p的动作是该对象动作的正确子集<p>
 <li> <i>p</i>'s port range is included in this port range. Note:
 port range is ignored when p only contains the action, 'resolve'.
 p的端口范围在此对象端口范围内。注意:只有当p仅包含动作“resolve”时,端口范围被忽略。<p>
 </ul>
 
 Then <code>implies</code> checks each of the following, in order,
 and for each returns true if the stated condition is true:
 implies方法按顺序检查下列条件,如果规定条件为true,则每一个都返回true:<p>
 <ul>
 <li> If this object was initialized with a single IP address and one of <i>p</i>'s
 IP addresses is equal to this object's IP address.
 如果此对象用单个IP地址初始化,且P参数的IP地址集中的一个同此对象的IP地址相同:<p>
 <li>If this object is a wildcard domain (such as *.sun.com), and
 如果此对象是一个通配符域名(例如*.sun.com)
 <i>p</i>'s canonical name (the name without any preceding *)
 ends with this object's canonical host name. For example, *.sun.com
 implies *.eng.sun.com..
 p参数的规范名称(不包括任何前置*)以此对象的规范主机。例如,*.sun.com隐含了*.eng.sun.com<p>
 <li>If this object was not initialized with a single IP address, and one of this
 object's IP addresses equals one of <i>p</i>'s IP addresses.
 如果此对象不是用单个IP地址初始化,但此对象IP地址中的一个同p参数的IP地址集中的一个相同。<p>
 <li>If this canonical name equals <i>p</i>'s canonical name.
 如果此规范名称和p的规范名称相同。<p>
 </ul>
 
 If none of the above are true, <code>implies</code> returns false.
 如果上面的条件有一个不为true,则implies返回false。
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../java/security/Permission.html#implies(java.security.Permission)">implies</A></CODE> in class <CODE><A HREF="../../java/security/Permission.html" title="class in java.security">Permission</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>p</CODE> - the permission to check against. 要检查的许可。
<DT><B>Returns:</B><DD>true if the specified permission is implied by this object,
 false if not.
 如果此对象隐含有指定的许可,返回true,否则返回false。</DL>
</DD>
</DL>
<HR>

<A NAME="equals(java.lang.Object)"><!-- --></A><H3>
equals</H3>
<PRE>
public boolean <B>equals</B>(<A HREF="../../java/lang/Object.html" title="class in java.lang">Object</A>&nbsp;obj)</PRE>
<DL>
<DD>Checks two SocketPermission objects for equality.
检查两个SocketPermission对象是否相等。
 <P>
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../java/security/Permission.html#equals(java.lang.Object)">equals</A></CODE> in class <CODE><A HREF="../../java/security/Permission.html" title="class in java.security">Permission</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>obj</CODE> - the object to test for equality with this object. 测试是否同此对象相同的对象。
<DT><B>Returns:</B><DD>true if <i>obj</i> is a SocketPermission, and has the
  same hostname, port range, and actions as this
  SocketPermission object. However, port range will be ignored
  in the comparison if <i>obj</i> only contains the action, 'resolve'.
  如果obj是一个SocketPermission,且同此SocketPermission对象拥有相同的主机名、端口范围和动作,返回true。
  然而,如果obj仅包含动作resolve,那么比较中忽略端口范围。</DL>
</DD>
</DL>
<HR>

<A NAME="hashCode()"><!-- --></A><H3>
hashCode</H3>
<PRE>
public int <B>hashCode</B>()</PRE>
<DL>
<DD>Returns the hash code value for this object. 返回此对象的hash码值。
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../java/security/Permission.html#hashCode()">hashCode</A></CODE> in class <CODE><A HREF="../../java/security/Permission.html" title="class in java.security">Permission</A></CODE></DL>
</DD>
<DD><DL>

<DT><B>Returns:</B><DD>a hash code value for this object. 此对象的hash码值。</DL>
</DD>
</DL>
<HR>

<A NAME="getActions()"><!-- --></A><H3>
getActions</H3>
<PRE>
public <A HREF="../../java/lang/String.html" title="class in java.lang">String</A> <B>getActions</B>()</PRE>
<DL>
<DD>Returns the canonical string representation of the actions.
 Always returns present actions in the following order:
 connect, listen, accept, resolve.
 返回动作的符合规定的字符串形式。总是按以下顺序返回当前动作: connect、 listen、accept、resolve。
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../java/security/Permission.html#getActions()">getActions</A></CODE> in class <CODE><A HREF="../../java/security/Permission.html" title="class in java.security">Permission</A></CODE></DL>
</DD>
<DD><DL>

<DT><B>Returns:</B><DD>the canonical string representation of the actions. 动作的符合规定的字符串形式。</DL>
</DD>
</DL>
<HR>

<A NAME="newPermissionCollection()"><!-- --></A><H3>
newPermissionCollection</H3>
<PRE>
public <A HREF="../../java/security/PermissionCollection.html" title="class in java.security">PermissionCollection</A> <B>newPermissionCollection</B>()</PRE>
<DL>
<DD>Returns a new PermissionCollection object for storing SocketPermission
 objects.
 返回一个新的存储SocketPermission的PermissionCollection。
 <p>
 SocketPermission 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 <code>implies</code>
 method to be implemented in an efficient (and consistent) manner.
 SocketPermission对象必须以一种允许其以任意顺序插入集合的方式存储,但同时这种方式还使得PermissionCollection
 的implies方法以有效(一致)的方式被实现。
<P>
<DD><DL>
<DT><B>Overrides:</B><DD><CODE><A HREF="../../java/security/Permission.html#newPermissionCollection()">newPermissionCollection</A></CODE> in class <CODE><A HREF="../../java/security/Permission.html" title="class in java.security">Permission</A></CODE></DL>
</DD>
<DD><DL>

<DT><B>Returns:</B><DD>a new PermissionCollection object suitable for storing SocketPermissions.
适合存储SocketPermissions的新的PermissionCollection对象。</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>


<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/SocketPermission.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
<b>Java<sup><font size=-2>TM</font></sup>&nbsp;2&nbsp;Platform<br>Std.&nbsp;Ed. v1.4.2</b></EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../java/net/SocketImpl.html" title="class in java.net"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../java/net/URI.html" title="class in java.net"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../index.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="SocketPermission.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>

</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->

<HR>
<font size="-1"><a href="http://java.sun.com/cgi-bin/bugreport.cgi">Submit a bug or feature</a><br>For further API reference and developer documentation, see <a href="../../../relnotes/devdocs-vs-specs.html">Java 2 SDK SE Developer Documentation</a>. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples. <p>Copyright 2003 Sun Microsystems, Inc. All rights reserved. Use is subject to <a href="../../../relnotes/license.html">license terms</a>. Also see the <a href="http://java.sun.com/docs/redist.html">documentation redistribution policy</a>.</font>
</BODY>
</HTML>

本文地址:http://com.8s8s.com/it/it10016.htm