📄 ipaddress.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd"><!--NewPage--><HTML><HEAD><!-- Generated by javadoc on Thu Sep 14 11:15:57 JST 2000 --><TITLE>: Class IPAddress</TITLE><LINK REL ="stylesheet" TYPE="text/css" HREF="../stylesheet.css" TITLE="Style"></HEAD><BODY BGCOLOR="white"><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_top"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_top_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT ID="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT ID="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../deprecated-list.html"><FONT ID="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../index-all.html"><FONT ID="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../help-doc.html"><FONT ID="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../jpcap/ICMPPacket.html"><B>PREV CLASS</B></A> <A HREF="../jpcap/IPPacket.html"><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> <A HREF="IPAddress.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: INNER | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR><!-- ======== START OF CLASS DATA ======== --><H2><FONT SIZE="-1">jpcap</FONT><BR>Class IPAddress</H2><PRE>java.lang.Object | +--<B>jpcap.IPAddress</B></PRE><HR><DL><DT>public class <B>IPAddress</B><DT>extends java.lang.Object</DL><P>This class represents an IP address.<BR> <BR> Either IPv4 and IPv6 addresses can be represented by this class.<P><HR><P><!-- ======== INNER CLASS SUMMARY ======== --><!-- =========== FIELD SUMMARY =========== --><!-- ======== CONSTRUCTOR SUMMARY ======== --><A NAME="constructor_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><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="../jpcap/IPAddress.html#IPAddress(byte[])">IPAddress</A></B>(byte[] address)</CODE><BR> Creates IP address of the specified byte array.<BR> This doesn't check if the address is valid.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../jpcap/IPAddress.html#IPAddress(int, byte[])">IPAddress</A></B>(int version, byte[] address)</CODE><BR> Creates IP address of the specified version and byte array.<BR> This doesn't check if the address is valid.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../jpcap/IPAddress.html#IPAddress(int, java.lang.String)">IPAddress</A></B>(int version, java.lang.String address)</CODE><BR> Creates an IP address of the specified version and IP address or domain name.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../jpcap/IPAddress.html#IPAddress(java.lang.String)">IPAddress</A></B>(java.lang.String address)</CODE><BR> Creates IPv4 address of the specified address or domain name.</TD></TR></TABLE> <!-- ========== METHOD SUMMARY =========== --><A NAME="method_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><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> boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../jpcap/IPAddress.html#equals(java.lang.Object)">equals</A></B>(java.lang.Object p)</CODE><BR> Check if this object is equal to the given object.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> byte[]</CODE></FONT></TD><TD><CODE><B><A HREF="../jpcap/IPAddress.html#getAddress()">getAddress</A></B>()</CODE><BR> Returns the byte array of this object.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../jpcap/IPAddress.html#getHostAddress()">getHostAddress</A></B>()</CODE><BR> Returns the IP address string "%d.%d.%d.%d" or "%x:%x::%x:%x"</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../jpcap/IPAddress.html#getHostName()">getHostName</A></B>()</CODE><BR> Return the domain name of this object.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> java.net.InetAddress</CODE></FONT></TD><TD><CODE><B><A HREF="../jpcap/IPAddress.html#getInetAddress()">getInetAddress</A></B>()</CODE><BR> Returns the instance of java.net.InetAddress, if this is IPv4 address.<BR> Returns null if this is IPv6.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../jpcap/IPAddress.html#toString()">toString</A></B>()</CODE><BR> Returns the IP address string "%d.%d.%d.%d" or "%x:%x::%x:%x"</TD></TR></TABLE> <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from class java.lang.Object</B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE>getClass, hashCode, notify, notifyAll, wait, wait, wait</CODE></TD></TR></TABLE> <P><!-- ============ FIELD DETAIL =========== --><!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Constructor Detail</B></FONT></TD></TR></TABLE><A NAME="IPAddress(int, java.lang.String)"><!-- --></A><H3>IPAddress</H3><PRE>public <B>IPAddress</B>(int version, java.lang.String address) throws java.net.UnknownHostException</PRE><DL><DD>Creates an IP address of the specified version and IP address or domain name.<DD><DL><DT><B>Parameters:</B><DD><CODE>version</CODE> - version of this IP address<DD><CODE>address</CODE> - IP address or domain name</DL></DD></DL><HR><A NAME="IPAddress(java.lang.String)"><!-- --></A><H3>IPAddress</H3><PRE>public <B>IPAddress</B>(java.lang.String address) throws java.net.UnknownHostException</PRE><DL><DD>Creates IPv4 address of the specified address or domain name.<DD><DL><DT><B>Parameters:</B><DD><CODE>address</CODE> - IP address or domain name</DL></DD></DL><HR><A NAME="IPAddress(int, byte[])"><!-- --></A><H3>IPAddress</H3><PRE>public <B>IPAddress</B>(int version, byte[] address)</PRE><DL><DD>Creates IP address of the specified version and byte array.<BR> This doesn't check if the address is valid.<DD><DL><DT><B>Parameters:</B><DD><CODE>address</CODE> - byte array of an IP address</DL></DD></DL><HR><A NAME="IPAddress(byte[])"><!-- --></A><H3>IPAddress</H3><PRE>public <B>IPAddress</B>(byte[] address)</PRE><DL><DD>Creates IP address of the specified byte array.<BR> This doesn't check if the address is valid.<DD><DL><DT><B>Parameters:</B><DD><CODE>address</CODE> - byte array of an IP address</DL></DD></DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="getAddress()"><!-- --></A><H3>getAddress</H3><PRE>public byte[] <B>getAddress</B>()</PRE><DL><DD>Returns the byte array of this object.</DL><HR><A NAME="getHostAddress()"><!-- --></A><H3>getHostAddress</H3><PRE>public java.lang.String <B>getHostAddress</B>()</PRE><DL><DD>Returns the IP address string "%d.%d.%d.%d" or "%x:%x::%x:%x"</DL><HR><A NAME="getHostName()"><!-- --></A><H3>getHostName</H3><PRE>public java.lang.String <B>getHostName</B>() throws java.net.UnknownHostException</PRE><DL><DD>Return the domain name of this object.</DL><HR><A NAME="getInetAddress()"><!-- --></A><H3>getInetAddress</H3><PRE>public java.net.InetAddress <B>getInetAddress</B>() throws java.net.UnknownHostException</PRE><DL><DD>Returns the instance of java.net.InetAddress, if this is IPv4 address.<BR> Returns null if this is IPv6.</DL><HR><A NAME="equals(java.lang.Object)"><!-- --></A><H3>equals</H3><PRE>public boolean <B>equals</B>(java.lang.Object p)</PRE><DL><DD>Check if this object is equal to the given object.<DD><DL><DT><B>Overrides:</B><DD>equals in class java.lang.Object</DL></DD></DL><HR><A NAME="toString()"><!-- --></A><H3>toString</H3><PRE>public java.lang.String <B>toString</B>()</PRE><DL><DD>Returns the IP address string "%d.%d.%d.%d" or "%x:%x::%x:%x"<DD><DL><DT><B>Overrides:</B><DD>toString in class java.lang.Object</DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_bottom"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT ID="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT ID="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../deprecated-list.html"><FONT ID="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../index-all.html"><FONT ID="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../help-doc.html"><FONT ID="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../jpcap/ICMPPacket.html"><B>PREV CLASS</B></A> <A HREF="../jpcap/IPPacket.html"><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> <A HREF="IPAddress.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: INNER | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -