org.jgroups.stack
Class IpAddress
java.lang.Object
org.jgroups.stack.IpAddress
- Address, Cloneable, Comparable, Externalizable, Streamable
public class IpAddress
extends java.lang.Object
Network-dependent address (Internet). Generated by the bottommost layer of the protocol
stack (UDP). Contains an InetAddress and port.
Object | clone()
|
int | compare(IpAddress other) - Establishes an order between 2 addresses.
|
int | compareTo(Object o) - implements the java.lang.Comparable interface
|
boolean | equals(Object obj)
|
byte[] | getAdditionalData() - Returns the additional_data.
|
InetAddress | getIpAddress()
|
int | getPort()
|
int | hashCode()
|
boolean | isMulticastAddress() - Checks whether this is an address that represents multiple destinations;
e.g., a class D address in the Internet.
|
void | readExternal(ObjectInput in)
|
void | readFrom(DataInputStream in) - Read the state of the current object (including superclasses) from instream
Note that the input stream must not be closed
|
void | setAdditionalData(byte[] additional_data) - Sets the additional_data.
|
int | size() - Returns serialized size of this address
|
String | toString()
|
void | writeExternal(ObjectOutput out)
|
void | writeTo(DataOutputStream out) - Write the entire state of the current object (including superclasses) to outstream.
|
log
protected static final Log log
IpAddress
public IpAddress()
IpAddress
public IpAddress(InetAddress i,
int p)
IpAddress
public IpAddress(String i,
int p)
IpAddress
public IpAddress(int port)
IpAddress
public IpAddress(int port,
boolean set_default_host)
clone
public Object clone()
throws CloneNotSupportedException
compare
public final int compare(IpAddress other)
Establishes an order between 2 addresses. Assumes other contains non-null IpAddress.
Excludes channel_name from comparison.
- 0 for equality, value less than 0 if smaller, greater than 0 if greater.
compareTo
public final int compareTo(Object o)
implements the java.lang.Comparable interface
o
- - the Object to be compared
- a negative integer, zero, or a positive integer as this object is less than,
equal to, or greater than the specified object.
equals
public final boolean equals(Object obj)
getAdditionalData
public final byte[] getAdditionalData()
Returns the additional_data.
getIpAddress
public final InetAddress getIpAddress()
getPort
public final int getPort()
hashCode
public final int hashCode()
isMulticastAddress
public final boolean isMulticastAddress()
Checks whether this is an address that represents multiple destinations;
e.g., a class D address in the Internet.
- isMulticastAddress in interface Address
- true if this is a multicast address, false if it is a unicast address
readExternal
public void readExternal(ObjectInput in)
throws IOException,
ClassNotFoundException
readFrom
public void readFrom(DataInputStream in)
throws IOException
Read the state of the current object (including superclasses) from instream
Note that the input stream must not be closed
- readFrom in interface Streamable
setAdditionalData
public final void setAdditionalData(byte[] additional_data)
Sets the additional_data.
additional_data
- The additional_data to set
size
public int size()
Returns serialized size of this address
- size in interface Address
toString
public String toString()
writeExternal
public void writeExternal(ObjectOutput out)
throws IOException
writeTo
public void writeTo(DataOutputStream out)
throws IOException
Write the entire state of the current object (including superclasses) to outstream.
Note that the output stream must not be closed
- writeTo in interface Streamable
Copyright B) 1998-2005 Bela Ban. All Rights Reserved.