jfreerails.world.top
Class ITEM

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

public class ITEM
extends java.lang.Object
implements FreerailsSerializable

This class provides a set of keys to access the items of which there can only be one instance in the game world in the game world (for example, the current time).

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

Author:
Luke
See Also:
Serialized Form

Field Summary
static ITEM CALENDAR
           
static ITEM ECONOMIC_CLIMATE
           
static ITEM GAME_RULES
           
static ITEM GAME_SPEED
           
private  int keyNumber
           
private static ITEM[] keys
          Maps key numbers to KEYs.
private static int numberOfKeys
           
private static long serialVersionUID
           
 
Constructor Summary
private ITEM()
           
 
Method Summary
(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 ITEM[] keys
Maps key numbers to KEYs.


CALENDAR

public static final ITEM CALENDAR

GAME_RULES

public static final ITEM GAME_RULES

GAME_SPEED

public static final ITEM GAME_SPEED

ECONOMIC_CLIMATE

public static final ITEM ECONOMIC_CLIMATE

numberOfKeys

private static int numberOfKeys

keyNumber

private final int keyNumber
Constructor Detail

ITEM

private ITEM()
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