Package org.jgroups.stack
Class IpAddress
java.lang.Object
org.jgroups.stack.IpAddress
- All Implemented Interfaces:
Comparable<Address>,Address,Constructable<IpAddress>,PhysicalAddress,SizeStreamable,Streamable
Network-dependent address (Internet). Generated by the bottommost layer of the protocol
stack (UDP). Contains an InetAddress and port.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintimplements the java.lang.Comparable interfacecopy()create()Creates an instance of the class implementing this interfacebooleanintgetPort()inthashCode()voidRead the state of the current object (including superclasses) from instream Note that the input stream must not be closedintReturns the size (in bytes) of the marshalled objectprotected voidtoString()voidwriteTo(DataOutput out) Write the entire state of the current object (including superclasses) to outstream.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.jgroups.Address
isMulticast, isSiteAddress, isSiteMaster
-
Field Details
-
ip_addr
-
port
protected int port
-
-
Constructor Details
-
IpAddress
public IpAddress() -
IpAddress
e.g. 192.168.1.5:7800- Throws:
Exception
-
IpAddress
- Throws:
UnknownHostException
-
IpAddress
-
IpAddress
public IpAddress(int port) -
IpAddress
public IpAddress(int port, boolean set_default_host) -
IpAddress
-
-
Method Details
-
create
Description copied from interface:ConstructableCreates an instance of the class implementing this interface- Specified by:
createin interfaceConstructable<IpAddress>
-
setAddressToLocalHost
protected void setAddressToLocalHost() -
getIpAddress
-
getPort
public int getPort() -
compareTo
implements the java.lang.Comparable interface- Specified by:
compareToin interfaceComparable<Address>- 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:
ClassCastException- - if the specified object's type prevents it from being compared to this Object.- See Also:
-
equals
-
hashCode
public int hashCode() -
toString
-
printIpAddress
- Specified by:
printIpAddressin interfacePhysicalAddress
-
printIpAddress2
-
printHostAddress
-
writeTo
Description copied from interface:StreamableWrite the entire state of the current object (including superclasses) to outstream. Note that the output stream must not be closed- Specified by:
writeToin interfaceStreamable- Throws:
IOException
-
readFrom
Description copied from interface:StreamableRead the state of the current object (including superclasses) from instream Note that the input stream must not be closed- Specified by:
readFromin interfaceStreamable- Throws:
IOException
-
serializedSize
public int serializedSize()Description copied from interface:SizeStreamableReturns the size (in bytes) of the marshalled object- Specified by:
serializedSizein interfaceSizeStreamable
-
copy
-