viceroy
Class PeerState

java.lang.Object
  |
  +--viceroy.PeerState
All Implemented Interfaces:
java.io.Serializable

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

Represent a state of a peer in a given time This is a type-safe enum implementation

Author:
Anat Talmy
, Oren Dobzinski
See Also:
Serialized Form

Field Summary
static PeerState ACTIVE
          State - Active
static PeerState INACTIVE
          State - Inactive
static PeerState JOINING
          State - Joining
static PeerState LEAVING
          State - Leaving
private  java.lang.String name
          The peer's name
private static int nextOrdinal
           
private  int ordinal
           
private static PeerState[] PRIVATE_VALUES
          The states of a peer (private)
static java.util.List VALUES
          An unmodifiable list of peer's states
 
Constructor Summary
private PeerState(java.lang.String _name)
          A constructor.
 
Method Summary
 boolean equals(java.lang.Object that)
           
 int hashCode()
           
(package private)  java.lang.Object readResolve()
           
 java.lang.String toString()
          toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

name

private final java.lang.String name
The peer's name


INACTIVE

public static final PeerState INACTIVE
State - Inactive


JOINING

public static final PeerState JOINING
State - Joining


ACTIVE

public static final PeerState ACTIVE
State - Active


LEAVING

public static final PeerState LEAVING
State - Leaving


PRIVATE_VALUES

private static final PeerState[] PRIVATE_VALUES
The states of a peer (private)


VALUES

public static final java.util.List VALUES
An unmodifiable list of peer's states


nextOrdinal

private static int nextOrdinal

ordinal

private final int ordinal
Constructor Detail

PeerState

private PeerState(java.lang.String _name)
A constructor.

Parameters:
_name - The name of the peer
Method Detail

toString

public java.lang.String toString()
toString

Overrides:
toString in class java.lang.Object
Returns:
the name of the peer

equals

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

hashCode

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

readResolve

java.lang.Object readResolve()
                       throws java.io.ObjectStreamException
java.io.ObjectStreamException