org.gjt.universe
Class GalaxyElliptical

java.lang.Object
  |
  +--org.gjt.universe.DBItem
        |
        +--org.gjt.universe.GalaxyBase
              |
              +--org.gjt.universe.GalaxyStd
                    |
                    +--org.gjt.universe.GalaxyElliptical
All Implemented Interfaces:
java.io.Serializable

public class GalaxyElliptical
extends GalaxyStd

The GalaxyElliptical class used for galaxies containing a random scattering of star systems with an overall structure which astronomers refer to as elliptical. Such galaxies are spheroid in shape.

Author:
Allan Noordvyk (noordvyk@home.com)
See Also:
Serialized Form

Field Summary
static java.lang.String DESCRIPTION
           
 
Fields inherited from class org.gjt.universe.GalaxyStd
ourRandGen
 
Fields inherited from class org.gjt.universe.GalaxyBase
 
Constructor Summary
GalaxyElliptical(float width, float height, float depth, float density)
          This is the designated constructor which should be used to create instances this class.
 
Method Summary
 boolean containsCoord(Coord aCoord)
          This method returns true if the given coordinate is contained within the hull of the receiving galaxy.
 Coord newSystemCoord()
          This method has been overridden to return a new coordinate contained within the spheroid with the receiver's axial dimensions and center.
 int starSystemCount()
          This method overrides that of our superclass to return the average number of star systems that should be present in a spheroid galaxy with our dimensions and average density.
 java.lang.String structureDescription()
          This method overrides that of our superclass to return "Elliptical".
 
Methods inherited from class org.gjt.universe.GalaxyStd
generateSystems, getCenter, getDensity, getSpan, specificDisplayDebug
 
Methods inherited from class org.gjt.universe.GalaxyBase
addSystem, getGalaxySystems, getID, getIndex, getName, getRandomSystem, getRandomSystemID, getRandomSystemIDs, hasGeneratedSystems, setName
 
Methods inherited from class org.gjt.universe.DBItem
getLocation, getOwner
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DESCRIPTION

public static java.lang.String DESCRIPTION
Constructor Detail

GalaxyElliptical

public GalaxyElliptical(float width,
                        float height,
                        float depth,
                        float density)
This is the designated constructor which should be used to create instances this class.

Parameters:
width - The width of the galaxy (in parsecs)
height - The height of the galaxy (in parsecs)
depth - The depth of the galaxy (in parsecs)
density - The average density (in systems per cubic parsec) of stars within the hull of the galaxy (not its bounding cube).
Method Detail

structureDescription

public java.lang.String structureDescription()
This method overrides that of our superclass to return "Elliptical".

Overrides:
structureDescription in class GalaxyStd

starSystemCount

public int starSystemCount()
This method overrides that of our superclass to return the average number of star systems that should be present in a spheroid galaxy with our dimensions and average density.

Overrides:
starSystemCount in class GalaxyStd

newSystemCoord

public Coord newSystemCoord()
This method has been overridden to return a new coordinate contained within the spheroid with the receiver's axial dimensions and center.

Overrides:
newSystemCoord in class GalaxyStd
Returns:
An unoccupied coordinate within the galaxy suitable for placement of a new star system.
See Also:
#containsCoord()

containsCoord

public boolean containsCoord(Coord aCoord)
This method returns true if the given coordinate is contained within the hull of the receiving galaxy. This subclass overrides the superclass implementation in order to ensure that the supplied coordinate is within our spheroid boundary.

Overrides:
containsCoord in class GalaxyStd
Parameters:
aCoord - The coordinate to be tested.
See Also:
GalaxyStd.newSystemCoord()


Copyright © 2001 Universe Dev Team All Rights Reserved.