viceroy
Class Relative

java.lang.Object
  |
  +--viceroy.Relative
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
Connection

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

Represent a type of a relative in the viceroy network: parent,left child or right child. This is a type-safe enum implementation.

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

Field Summary
static Relative LEFT_CHILD
          Relative - left child
private  java.lang.String name
          The type's name
private static int nextOrdinal
           
private  int ordinal
           
static Relative PARENT
          Relative - parent
private static Relative[] PRIVATE_VALUES
          The Relative that can be in our system
static Relative RIGHT_CHILD
          Relative - right child
static java.util.List VALUES
          An unmodifiable list of the Relatives
 
Constructor Summary
protected Relative(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 transient java.lang.String name
The type's name


PARENT

public static final Relative PARENT
Relative - parent


LEFT_CHILD

public static final Relative LEFT_CHILD
Relative - left child


RIGHT_CHILD

public static final Relative RIGHT_CHILD
Relative - right child


PRIVATE_VALUES

private static final Relative[] PRIVATE_VALUES
The Relative that can be in our system


VALUES

public static final java.util.List VALUES
An unmodifiable list of the Relatives


nextOrdinal

private static int nextOrdinal

ordinal

private final int ordinal
Constructor Detail

Relative

protected Relative(java.lang.String _name)
A constructor.

Parameters:
_name - The name of the type
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