org.jgroups.stack
Class IpAddress
java.lang.Object
org.jgroups.stack.IpAddress
- Address, Cloneable, Comparable, Externalizable
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.
log
protected static Log log
sAddrCache
protected static HashMap sAddrCache
IpAddress
public IpAddress()
IpAddress
public IpAddress(InetAddress i,
int p)
IpAddress
public IpAddress(String i,
int p)
IpAddress
public IpAddress(int port)
clone
public Object clone()
throws CloneNotSupportedException
compare
public 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 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 boolean equals(Object obj)
getAdditionalData
public byte[] getAdditionalData()
Returns the additional_data.
getIpAddress
public InetAddress getIpAddress()
getIpAddress
protected static InetAddress getIpAddress(byte[] addr)
getPort
public int getPort()
hashCode
public int hashCode()
isMulticastAddress
public 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
setAdditionalData
public void setAdditionalData(byte[] additional_data)
Sets the additional_data.
additional_data
- The additional_data to set
toString
public String toString()
writeExternal
public void writeExternal(ObjectOutput out)
throws IOException
Copyright B) 2001,2002 www.jgroups.com . All Rights Reserved.