public class IpAddress extends java.lang.Object implements PhysicalAddress
构造器和说明 |
---|
IpAddress() |
IpAddress(java.net.InetAddress i,
int p) |
IpAddress(java.net.InetSocketAddress sock_addr) |
IpAddress(int port) |
IpAddress(int port,
boolean set_default_host) |
IpAddress(java.lang.String addr_port)
e.g. 192.168.1.5:7800
|
IpAddress(java.lang.String i,
int p) |
限定符和类型 | 方法和说明 |
---|---|
int |
compareTo(Address o)
implements the java.lang.Comparable interface
|
IpAddress |
copy() |
boolean |
equals(java.lang.Object obj) |
java.net.InetAddress |
getIpAddress() |
int |
getPort() |
int |
hashCode() |
void |
readExternal(java.io.ObjectInput in) |
void |
readFrom(java.io.DataInput in)
Read the state of the current object (including superclasses) from instream
Note that the input stream must not be closed
|
int |
size()
Returns serialized size of this address
|
java.lang.String |
toString() |
void |
writeExternal(java.io.ObjectOutput out) |
void |
writeTo(java.io.DataOutput out)
Write the entire state of the current object (including superclasses) to outstream.
|
public IpAddress()
public IpAddress(java.lang.String addr_port) throws java.lang.Exception
java.lang.Exception
public IpAddress(java.lang.String i, int p) throws java.net.UnknownHostException
java.net.UnknownHostException
public IpAddress(java.net.InetAddress i, int p)
public IpAddress(int port)
public IpAddress(int port, boolean set_default_host)
public IpAddress(java.net.InetSocketAddress sock_addr)
public final java.net.InetAddress getIpAddress()
public final int getPort()
public final int compareTo(Address o)
compareTo
在接口中 java.lang.Comparable<Address>
o
- - the Object to be comparedjava.lang.ClassCastException
- - if the specified object's type prevents it
from being compared to this Object.Comparable
public final boolean equals(java.lang.Object obj)
equals
在类中 java.lang.Object
public final int hashCode()
hashCode
在类中 java.lang.Object
public java.lang.String toString()
toString
在类中 java.lang.Object
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
在接口中 java.io.Externalizable
java.io.IOException
java.lang.ClassNotFoundException
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
在接口中 java.io.Externalizable
java.io.IOException
public void writeTo(java.io.DataOutput out) throws java.lang.Exception
Streamable
writeTo
在接口中 Streamable
java.lang.Exception
public void readFrom(java.io.DataInput in) throws java.lang.Exception
Streamable
readFrom
在接口中 Streamable
java.lang.Exception
public int size()
Address
public IpAddress copy()