public class IpAddress extends java.lang.Object implements PhysicalAddress
Constructor and Description |
---|
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.
|
IpAddress(java.lang.String i,
int p) |
Modifier and Type | Method and Description |
---|---|
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
in interface 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
in class java.lang.Object
public final int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
java.io.IOException
java.lang.ClassNotFoundException
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
java.io.IOException
public void writeTo(java.io.DataOutput out) throws java.lang.Exception
Streamable
writeTo
in interface Streamable
java.lang.Exception
public void readFrom(java.io.DataInput in) throws java.lang.Exception
Streamable
readFrom
in interface Streamable
java.lang.Exception
public int size()
Address
public IpAddress copy()
Copyright © 1998-2020 Red Hat. All Rights Reserved.