org.gjt.universe
Class GalaxyList

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

public final class GalaxyList
extends java.lang.Object

This class handles look-up of specific galaxies by their unique ID.


Field Summary
private static DBList DB
           
 
Constructor Summary
private GalaxyList()
           
 
Method Summary
static void add(GalaxyBase obj)
           
static java.util.Enumeration elements()
          This method returns and enumeration of the galaxy list.
static GalaxyBase get(GalaxyID idx)
           
static GalaxyBase getRandomGalaxy()
          This method returns a star galaxy randomly selected from the list.
static GalaxyID getRandomGalaxyID()
          This method returns the ID of a star galaxy randomly selected from the list.
(package private) static void readObject(java.io.ObjectInputStream in)
           
static int size()
           
(package private) static void writeObject(java.io.ObjectOutputStream out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DB

private static DBList DB
Constructor Detail

GalaxyList

private GalaxyList()
Method Detail

add

public static void add(GalaxyBase obj)

get

public static GalaxyBase get(GalaxyID idx)

size

public static int size()

elements

public static java.util.Enumeration elements()
This method returns and enumeration of the galaxy list. No particular order is guaranteed.


writeObject

static void writeObject(java.io.ObjectOutputStream out)
                 throws java.io.IOException
java.io.IOException

readObject

static void readObject(java.io.ObjectInputStream in)
                throws java.io.IOException,
                       java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException

getRandomGalaxyID

public static GalaxyID getRandomGalaxyID()
This method returns the ID of a star galaxy randomly selected from the list. This method is slightly more efficient than getRandomGalaxy() and, therefore, should be used when only an ID, and not the actual galaxy object, is needed.

See Also:
getRandomGalaxy()

getRandomGalaxy

public static GalaxyBase getRandomGalaxy()
This method returns a star galaxy randomly selected from the list. This method is implemented by calling getRandomGalaxyID and then looking up the desired galaxy.

See Also:
getRandomGalaxyID()


Copyright © 2001 Universe Dev Team All Rights Reserved.