public class LogicalAddress extends java.lang.Object implements Address
Modifier and Type | Field and Description |
---|---|
protected static int |
count |
protected java.lang.String |
host |
protected int |
id |
protected boolean |
multicast_addr |
protected java.util.ArrayList |
physical_addrs
List
|
protected long |
timestamp |
Constructor and Description |
---|
LogicalAddress() |
LogicalAddress(java.lang.String host_name,
java.util.List physical_addrs)
Use this constructor to create an instance, not the null-constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addPhysicalAddress(java.net.SocketAddress addr)
For internal use only.
|
java.lang.Object |
clone() |
int |
compare(LogicalAddress other)
Establishes an order between 2 addresses.
|
int |
compareTo(java.lang.Object o)
implements the java.lang.Comparable interface
|
LogicalAddress |
copy() |
boolean |
equals(java.lang.Object obj) |
byte[] |
getAdditionalData()
Returns the additional_data.
|
java.lang.String |
getHost() |
long |
getId() |
java.util.ArrayList |
getPhysicalAddresses()
Returns a copy of the list of physical addresses.
|
java.net.SocketAddress |
getPrimaryPhysicalAddress() |
long |
getTimestamp() |
int |
hashCode() |
protected void |
init(java.lang.String host_name,
java.util.List physical_addrs) |
boolean |
isMulticastAddress()
Checks whether this is an address that represents multiple destinations;
e.g., a class D address in the Internet.
|
void |
readExternal(java.io.ObjectInput in) |
void |
readFrom(java.io.DataInputStream in)
Read the state of the current object (including superclasses) from instream
Note that the input stream must not be closed
|
void |
removeAllPhysicalAddresses()
For internal use only.
|
void |
removePhysicalAddress(java.net.SocketAddress addr)
For internal use only.
|
void |
setAdditionalData(byte[] additional_data)
Sets the additional_data.
|
void |
setPrimaryPhysicalAddress(java.net.SocketAddress primary_physical_addr) |
int |
size()
Returns serialized size of this address
|
java.lang.String |
toString() |
java.lang.String |
toString(boolean print_details) |
void |
writeExternal(java.io.ObjectOutput out) |
void |
writeTo(java.io.DataOutputStream out)
Write the entire state of the current object (including superclasses) to outstream.
|
protected static int count
protected java.lang.String host
protected long timestamp
protected int id
protected boolean multicast_addr
protected java.util.ArrayList physical_addrs
public LogicalAddress()
public LogicalAddress(java.lang.String host_name, java.util.List physical_addrs)
protected void init(java.lang.String host_name, java.util.List physical_addrs)
public java.lang.String getHost()
public long getTimestamp()
public long getId()
public java.net.SocketAddress getPrimaryPhysicalAddress()
public void setPrimaryPhysicalAddress(java.net.SocketAddress primary_physical_addr)
public java.util.ArrayList getPhysicalAddresses()
public void addPhysicalAddress(java.net.SocketAddress addr)
addr
- public void removePhysicalAddress(java.net.SocketAddress addr)
addr
- public void removeAllPhysicalAddresses()
public boolean isMulticastAddress()
Address
isMulticastAddress
in interface Address
public int size()
Address
public byte[] getAdditionalData()
public void setAdditionalData(byte[] additional_data)
additional_data
- The additional_data to setpublic int compare(LogicalAddress other)
public int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
o
- - the Object to be comparedjava.lang.ClassCastException
- - if the specified object's type prevents it
from being compared to this Object.Comparable
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toString(boolean print_details)
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
java.io.IOException
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 writeTo(java.io.DataOutputStream out) throws java.io.IOException
Streamable
writeTo
in interface Streamable
java.io.IOException
public void readFrom(java.io.DataInputStream in) throws java.io.IOException, java.lang.IllegalAccessException, java.lang.InstantiationException
Streamable
readFrom
in interface Streamable
java.io.IOException
java.lang.IllegalAccessException
java.lang.InstantiationException
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
public LogicalAddress copy()
Copyright ? 1998-2006 Bela Ban. All Rights Reserved.