viceroy
Class LookupState

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

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

Represent a state of a lookup action in a given time. This is a type-safe enum implementation.

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

Field Summary
private  java.lang.String name
          The peer's name
private static int nextOrdinal
           
private  int ordinal
           
private static LookupState[] PRIVATE_VALUES
          The states of a peer (private)
static LookupState PROCEED_TO_ROOT_VIA_PARENT
          State - proceed to root via parent indicates that in the proceed to root phase, we haven't encontered any null parent yet, so we are going up the parent links.
static LookupState PROCEED_TO_ROOT_VIA_SUCCESSOR
          State - proceed to root via successor indicates that in the proceed to root phase, we have encontered a null parent, sometime in the past, so now we are using successor links
static LookupState TRAVERSE_RING
          State - traverse ring
static LookupState TRAVERSE_TREE
          State - traverse tree
static java.util.List VALUES
          An unmodifiable list of peer's states
 
Constructor Summary
private LookupState(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


PROCEED_TO_ROOT_VIA_PARENT

public static final LookupState PROCEED_TO_ROOT_VIA_PARENT
State - proceed to root via parent indicates that in the proceed to root phase, we haven't encontered any null parent yet, so we are going up the parent links. Note: This was not written in the vicceroy article, and was added as a result of an infinite loop bug we've found.


PROCEED_TO_ROOT_VIA_SUCCESSOR

public static final LookupState PROCEED_TO_ROOT_VIA_SUCCESSOR
State - proceed to root via successor indicates that in the proceed to root phase, we have encontered a null parent, sometime in the past, so now we are using successor links


TRAVERSE_TREE

public static final LookupState TRAVERSE_TREE
State - traverse tree


TRAVERSE_RING

public static final LookupState TRAVERSE_RING
State - traverse ring


PRIVATE_VALUES

private static final LookupState[] 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

LookupState

private LookupState(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