jfreerails.world.top
Class SKEY

java.lang.Object
  extended by jfreerails.world.top.SKEY
All Implemented Interfaces:
java.io.Serializable, FreerailsSerializable

public class SKEY
extends java.lang.Object
implements FreerailsSerializable

This class provides a set of keys to access the lists of elements in the game world that are shared by all players.

It implements the typesafe enum pattern (see Bloch, Effective Java item 21)

Author:
Luke
See Also:
Serialized Form

Field Summary
static SKEY CARGO_TYPES
           
static SKEY CITIES
           
static SKEY ENGINE_TYPES
           
private  int keyNumber
           
private static SKEY[] keys
          Maps key numbers to KEYs.
private static int numberOfKeys
           
private static long serialVersionUID
           
static SKEY TERRAIN_TYPES
           
static SKEY TRACK_RULES
           
static SKEY WAGON_TYPES
           
 
Constructor Summary
private SKEY()
           
 
Method Summary
(package private) static SKEY getKey(int keyNum)
           
(package private)  int getKeyID()
           
(package private) static int getNumberOfKeys()
           
private  java.lang.Object readResolve()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

keys

private static final SKEY[] keys
Maps key numbers to KEYs.


TERRAIN_TYPES

public static final SKEY TERRAIN_TYPES

WAGON_TYPES

public static final SKEY WAGON_TYPES

CARGO_TYPES

public static final SKEY CARGO_TYPES

CITIES

public static final SKEY CITIES

ENGINE_TYPES

public static final SKEY ENGINE_TYPES

TRACK_RULES

public static final SKEY TRACK_RULES

numberOfKeys

private static int numberOfKeys

keyNumber

private final int keyNumber
Constructor Detail

SKEY

private SKEY()
Method Detail

getNumberOfKeys

static int getNumberOfKeys()

getKeyID

int getKeyID()

readResolve

private java.lang.Object readResolve()
                              throws java.io.ObjectStreamException
Throws:
java.io.ObjectStreamException

toString

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

getKey

static SKEY getKey(int keyNum)