org.jgroups
Class ViewId
- Cloneable, Comparable, Externalizable, Streamable
public class ViewId
extends java.lang.Object
implements Externalizable, Comparable, Cloneable, Streamable
ViewIds are used for ordering views (each view has a ViewId and a list of members).
Ordering between views is important for example in a virtual synchrony protocol where
all views seen by a member have to be ordered.
ViewId()
|
ViewId(Address coord_addr) - Creates a ViewID with the coordinator address and a Lamport timestamp of 0.
|
ViewId(Address coord_addr, long id) - Creates a ViewID with the coordinator address and the given Lamport timestamp.
|
Object | clone() - Cloneable interface
Returns a new ViewID object containing the same address and lamport timestamp as this view
|
int | compare(Object o) - Old Compare
|
int | compareTo(Object other) - Establishes an order between 2 ViewIds.
|
ViewId | copy() - Old Copy method, deprecated because it is substituted by clone()
|
boolean | equals(Object other_view)
|
Address | getCoordAddress() - returns the address of the member that issued this view
|
long | getId() - returns the lamport time of the view
|
int | hashCode()
|
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
|
int | serializedSize()
|
String | toString()
|
void | writeExternal(ObjectOutput out)
|
void | writeTo(DataOutputStream out) - Write the entire state of the current object (including superclasses) to outstream.
|
ViewId
public ViewId(Address coord_addr)
Creates a ViewID with the coordinator address and a Lamport timestamp of 0.
coord_addr
- the address of the member that issued this view
ViewId
public ViewId(Address coord_addr,
long id)
Creates a ViewID with the coordinator address and the given Lamport timestamp.
coord_addr
- - the address of the member that issued this viewid
- - the Lamport timestamp of the view
clone
public Object clone()
Cloneable interface
Returns a new ViewID object containing the same address and lamport timestamp as this view
compare
public int compare(Object o)
Old Compare
compareTo
public int compareTo(Object other)
Establishes an order between 2 ViewIds. First compare on id. Compare on coord_addr
only if necessary (i.e. ids are equal) !
- 0 for equality, value less than 0 if smaller, greater than 0 if greater.
copy
public ViewId copy()
Old Copy method, deprecated because it is substituted by clone()
equals
public boolean equals(Object other_view)
getCoordAddress
public Address getCoordAddress()
returns the address of the member that issued this view
- the Address of the the issuer
getId
public long getId()
returns the lamport time of the view
- the lamport time timestamp
hashCode
public int hashCode()
readExternal
public void readExternal(ObjectInput in)
throws IOException,
ClassNotFoundException
readFrom
public void readFrom(DataInputStream in)
throws IOException,
IllegalAccessException,
InstantiationException
Read the state of the current object (including superclasses) from instream
Note that the input stream must not be closed
- readFrom in interface Streamable
serializedSize
public int serializedSize()
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.