com.pegacat.vcf.data
Class Star

java.lang.Object
  |
  +--com.pegacat.vcf.data.VoyagerObject
        |
        +--com.pegacat.vcf.data.Star

public class Star
extends VoyagerObject

A Star in Voyager - contains a 3D location, as well as spectral data etc.

This class is a data holder for all this info, plus some nice-to-have utility methods for converting raw star data into easy listening descriptive strings...


Field Summary
protected  java.util.List bodies
          worlds/moons around this star
protected  int dist
           
protected  int multi
           
protected  int number
           
protected  int size
           
protected  int spectra
           
protected  double surveyDate
          date of the survey
protected  boolean surveyed
          has the star been star surveyed?
protected  int system
           
protected static com.pegacat.vcf.data.StarSystem[] systemList
           
 
Fields inherited from class com.pegacat.vcf.data.VoyagerObject
location, name, text
 
Constructor Summary
Star(int number, int x, int y, int z)
           
 
Method Summary
static void addStarToSystem(int system, Star star)
           
 double distanceFrom(Star other)
          Return the distance from another star.
 java.util.List getBodies()
           
 Body getBody(java.lang.String name)
          Gets a world/moon by name (NNNA(NN)?) Creation date: (31/05/2001 1:29:14 PM)
 int getDist()
           
 java.lang.String getDistance()
           
 int getMulti()
           
 int getNumber()
          return the star's number Creation date: (30/04/2001 11:53:22 AM)
 int getSize()
           
 int getSpectra()
           
 java.lang.String getSpectralType()
          Return the star spectra as a string.
 java.lang.String getStarSize()
          Return the star size as a string.
 double getSurveyDate()
           
 int getSystem()
           
 Star[] getSystemStars()
          Returns all the stars in this star's system (including this star).
 boolean isMulti()
           
 boolean isSurveyed()
           
 void setBodies(java.util.List newBodies)
           
 void setDist(int dist)
           
 void setMulti(int multi)
           
static void setNumberOfSystems(int n)
           
 void setSize(int size)
           
 void setSpectra(int spectra)
           
 void setSurveyDate(double newSurveyDate)
           
 void setSurveyed(boolean newSurveyed)
           
 void setSystem(int system)
           
static void setSystemSize(int system, int x, int y, int z, int size)
           
 java.lang.String toString()
           
 
Methods inherited from class com.pegacat.vcf.data.VoyagerObject
getLocation, getName, getNamedPosition, getText, getX, getY, getZ
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

spectra

protected int spectra

size

protected int size

multi

protected int multi

dist

protected int dist

number

protected int number

system

protected int system

surveyed

protected boolean surveyed
has the star been star surveyed?

surveyDate

protected double surveyDate
date of the survey

bodies

protected java.util.List bodies
worlds/moons around this star

note that the bodies *can* exist without a star survey, in which case they will be randomly sorted, but unsurveyed worlds will not have entries.


systemList

protected static com.pegacat.vcf.data.StarSystem[] systemList
Constructor Detail

Star

public Star(int number,
            int x,
            int y,
            int z)
Method Detail

setNumberOfSystems

public static void setNumberOfSystems(int n)

setSystemSize

public static void setSystemSize(int system,
                                 int x,
                                 int y,
                                 int z,
                                 int size)

addStarToSystem

public static void addStarToSystem(int system,
                                   Star star)

setSpectra

public void setSpectra(int spectra)

setSize

public void setSize(int size)

setMulti

public void setMulti(int multi)

setDist

public void setDist(int dist)

setSystem

public void setSystem(int system)

getSpectra

public int getSpectra()

getSize

public int getSize()

getMulti

public int getMulti()

getDist

public int getDist()

getSystem

public int getSystem()

isMulti

public boolean isMulti()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getSpectralType

public java.lang.String getSpectralType()
Return the star spectra as a string.

getStarSize

public java.lang.String getStarSize()
Return the star size as a string.

getDistance

public java.lang.String getDistance()

getSystemStars

public Star[] getSystemStars()
Returns all the stars in this star's system (including this star).

getNumber

public int getNumber()
return the star's number Creation date: (30/04/2001 11:53:22 AM)
Returns:
int

isSurveyed

public boolean isSurveyed()

setSurveyed

public void setSurveyed(boolean newSurveyed)

getBodies

public java.util.List getBodies()

getBody

public Body getBody(java.lang.String name)
Gets a world/moon by name (NNNA(NN)?) Creation date: (31/05/2001 1:29:14 PM)
Parameters:
name - string of form 123A or 123A1
Returns:
body selected, or null if no such body known

getSurveyDate

public double getSurveyDate()

setBodies

public void setBodies(java.util.List newBodies)

setSurveyDate

public void setSurveyDate(double newSurveyDate)

distanceFrom

public double distanceFrom(Star other)
Return the distance from another star. Creation date: (12/06/2001 8:56:19 PM)
Parameters:
other - com.pegacat.vcf.data.Star
Returns:
distance