JavaGroups
Class ViewId

java.lang.Object
  |
  +--JavaGroups.ViewId

public class ViewId
extends java.lang.Object
implements java.io.Serializable

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.

See Also:
Serialized Form

Constructor Summary
ViewId(java.lang.Object coord_addr)
           
ViewId(java.lang.Object coord_addr, long id)
           
 
Method Summary
 int Compare(ViewId other)
          Establishes an order between 2 ViewIds.
 ViewId Copy()
           
 boolean equals(java.lang.Object other_view)
           
 java.lang.Object GetCoordAddress()
           
 long GetId()
           
 int hashCode()
           
static void main(java.lang.String[] args)
           
 void SetCoordAddress(java.lang.Object new_addr)
           
 void SetId(long new_id)
          Deprecated. Since ViewIds should be immutable, this method will be removed soon !
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ViewId

public ViewId(java.lang.Object coord_addr)

ViewId

public ViewId(java.lang.Object coord_addr,
              long id)
Method Detail

GetId

public long GetId()

SetId

public void SetId(long new_id)
Deprecated. Since ViewIds should be immutable, this method will be removed soon !


GetCoordAddress

public java.lang.Object GetCoordAddress()

SetCoordAddress

public void SetCoordAddress(java.lang.Object new_addr)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

Copy

public ViewId Copy()

Compare

public int Compare(ViewId other)
Establishes an order between 2 ViewIds. First compare on id. Compare on coord_addr only if necessary (i.e. ids are equal) !
Returns:
0 for equality, value less than 0 if smaller, greater than 0 if greater.

equals

public boolean equals(java.lang.Object other_view)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

main

public static void main(java.lang.String[] args)