org.jgroups.stack

Class IpAddress

public class IpAddress extends Object implements Address

Network-dependent address (Internet). Generated by the bottommost layer of the protocol stack (UDP). Contains an InetAddress and port.

Author: Bela Ban

Field Summary
protected static Loglog
Constructor Summary
IpAddress()
IpAddress(String i, int p)
IpAddress(InetAddress i, int p)
IpAddress(int port)
IpAddress(int port, boolean set_default_host)
Method Summary
Objectclone()
intcompare(IpAddress other)
Establishes an order between 2 addresses.
intcompareTo(Object o)
implements the java.lang.Comparable interface
booleanequals(Object obj)
byte[]getAdditionalData()
Returns the additional_data.
InetAddressgetIpAddress()
intgetPort()
inthashCode()
booleanisMulticastAddress()
voidreadExternal(ObjectInput in)
voidreadFrom(DataInputStream in)
voidsetAdditionalData(byte[] additional_data)
Sets the additional_data.
intsize()
StringtoString()
voidwriteExternal(ObjectOutput out)
voidwriteTo(DataOutputStream out)

Field Detail

log

protected static final Log log

Constructor Detail

IpAddress

public IpAddress()

IpAddress

public IpAddress(String i, int p)

IpAddress

public IpAddress(InetAddress i, int p)

IpAddress

public IpAddress(int port)

IpAddress

public IpAddress(int port, boolean set_default_host)

Method Detail

clone

public Object clone()

compare

public final int compare(IpAddress other)
Establishes an order between 2 addresses. Assumes other contains non-null IpAddress. Excludes channel_name from comparison.

Returns: 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

Parameters: o - the Object to be compared

Returns: a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

Throws: java.lang.ClassCastException - if the specified object's type prevents it from being compared to this Object.

See Also: java.lang.Comparable

equals

public final boolean equals(Object obj)

getAdditionalData

public final byte[] getAdditionalData()
Returns the additional_data.

Returns: byte[]

getIpAddress

public final InetAddress getIpAddress()

getPort

public final int getPort()

hashCode

public final int hashCode()

isMulticastAddress

public final boolean isMulticastAddress()

readExternal

public void readExternal(ObjectInput in)

readFrom

public void readFrom(DataInputStream in)

setAdditionalData

public final void setAdditionalData(byte[] additional_data)
Sets the additional_data.

Parameters: additional_data The additional_data to set

size

public int size()

toString

public String toString()

writeExternal

public void writeExternal(ObjectOutput out)

writeTo

public void writeTo(DataOutputStream out)
Copyright ? 1998-2005 Bela Ban. All Rights Reserved.