org.gjt.universe
Class WormholeList

java.lang.Object
  |
  +--org.gjt.universe.WormholeList

public final class WormholeList
extends java.lang.Object

The this class handles look-up of specific wormholes by their unique ID.


Field Summary
private static DBTable DB
           
 
Constructor Summary
private WormholeList()
          This is declared privates as no actual instance of this class is ever created.
 
Method Summary
static void add(Wormhole obj)
          This method adds the given wormhole to the master list of those available in the game.
static java.util.Enumeration elements()
          This method returns an enumeration of all wormholes currently in the game.
static Wormhole get(WormholeID id)
          This method returns the wormhole with the given ID.
(package private) static void readObject(java.io.ObjectInputStream in)
          This method takes the list of wormholes stored in the given stream (previously written using writeObject) as the current list of those available in the game.
static Wormhole remove(WormholeID id)
          This method removes the given wormhole from the master list of those available in the game.
static int size()
          This method returns the number of wormholes in the game.
(package private) static void writeObject(java.io.ObjectOutputStream out)
          This method adds the current list of wormholes to the given stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DB

private static DBTable DB
Constructor Detail

WormholeList

private WormholeList()
This is declared privates as no actual instance of this class is ever created.

Method Detail

add

public static void add(Wormhole obj)
This method adds the given wormhole to the master list of those available in the game. This method is called automatically as part of the constructor for the wormhole class and thus need not be called directly by other objects.

Parameters:
obj - The wormhole to be added.

remove

public static Wormhole remove(WormholeID id)
This method removes the given wormhole from the master list of those available in the game. This method is called automatically by the Wormhole class when needed and thus need not be called directly by other objects.


get

public static Wormhole get(WormholeID id)
This method returns the wormhole with the given ID. If there is no such wormhole, this method will return an undefined wormhole object.

Parameters:
id - The unique ID of the desired wormhole object.
See Also:
class.

size

public static int size()
This method returns the number of wormholes in the game.


writeObject

static void writeObject(java.io.ObjectOutputStream out)
                 throws java.io.IOException
This method adds the current list of wormholes to the given stream. This method is typically called by code involved in saving a game.

java.io.IOException
See Also:
readObject

readObject

static void readObject(java.io.ObjectInputStream in)
                throws java.io.IOException,
                       java.lang.ClassNotFoundException
This method takes the list of wormholes stored in the given stream (previously written using writeObject) as the current list of those available in the game. This method is typically called by code involved in restoring a saved game.

java.io.IOException
java.lang.ClassNotFoundException
See Also:
writeObject

elements

public static java.util.Enumeration elements()
This method returns an enumeration of all wormholes currently in the game. No particular order is guaranteed.



Copyright © 2001 Universe Dev Team All Rights Reserved.