universe.server.database
Class GalaxyGliese

java.lang.Object
  |
  +--universe.common.database.DBItem
        |
        +--universe.server.database.GalaxyBase
              |
              +--universe.server.database.GalaxyGliese
All Implemented Interfaces:
java.io.Serializable

public class GalaxyGliese
extends GalaxyBase

Class used to represent a galaxy defined by the portion of the Milky Way contained in the Gliese Star Catalog.

While always returning the same fixed set of stars, the planets of star systems other than Sol are generated randomly.

Version:
$Id: GalaxyGliese.java,v 1.4 2003/04/03 00:20:54 sstarkey Exp $
See Also:
GlieseCatalog, Serialized Form

Field Summary
private  GlieseCatalog GalaxyCatalog
           
private  float GalaxyDiameter
           
 
Fields inherited from class universe.server.database.GalaxyBase
 
Constructor Summary
private GalaxyGliese()
          Don't allow default constructor
  GalaxyGliese(float diameter)
          This is the designated constructor which should be used to create instances this class.
 
Method Summary
 void generateSystems(float[] planetDistribution)
          This method extends that of our super class to causes the receiving galaxy to generate the random collection of star systems which it will contain and assign planets to each of these.
 
Methods inherited from class universe.server.database.GalaxyBase
addSystem, getID, getIndex, getName, getSystems, hasGeneratedSystems, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GalaxyDiameter

private float GalaxyDiameter

GalaxyCatalog

private GlieseCatalog GalaxyCatalog
Constructor Detail

GalaxyGliese

public GalaxyGliese(float diameter)
This is the designated constructor which should be used to create instances this class.

As with all galaxies, the actual stars and planets will not be present until generateSystems() has been called.

Parameters:
diameter - The maximum diameter of the resulting galaxy. Stars in the catalog beyond this range will be ignored.

GalaxyGliese

private GalaxyGliese()
Don't allow default constructor

Method Detail

generateSystems

public void generateSystems(float[] planetDistribution)
                     throws SchemeUnknownException,
                            java.lang.InterruptedException
This method extends that of our super class to causes the receiving galaxy to generate the random collection of star systems which it will contain and assign planets to each of these. Subclass should not need to override this method as it calls starSystemCount and randomCoord (which should be overridden) in order to do its work. Calls to this method after the galaxy is already populated with star systems will have no effect.

Overrides:
generateSystems in class GalaxyBase
Parameters:
planetDistribution - Array of floating point values representing the probability of finding planet mass at successive distances from its primary.
Throws:
SchemeUnknownException - If unable to determine a ID of the galaxy to which systems are to be added.
java.lang.InterruptedException - If access to a resource needed for star system generation has been interrupted.
See Also:
GalaxyBase.hasGeneratedSystems()


Copyright © 2001 Universe Dev Team All Rights Reserved.