org.gjt.universe
Class StationBase

java.lang.Object
  |
  +--org.gjt.universe.DBItem
        |
        +--org.gjt.universe.StationBase
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
Station_001, StationUndefined

public abstract class StationBase
extends DBItem

See Also:
Serialized Form

Field Summary
private static StationID currentID
           
private  StationID ID
           
private  VectorModuleID modules
           
private  java.lang.String name
           
private  CivID owner
           
 
Constructor Summary
protected StationBase()
          Default constructor for StationUndefined object.
protected StationBase(CivID civID, java.lang.String in_name)
          Standard constructor for this base object.
 
Method Summary
 void addModule(ModuleID MID)
          Adds a module to the list of modules for this station.
protected  void announceCreation()
          This method announces, via a notification posted on the default notification center that the instance exists.
 void destroyModule(ModuleID MID)
          This method removes the module with the given ID from the station.
abstract  AttackBase getAttack()
          Return the attack characteristics of this station.
abstract  DefenseBase getDefense()
          Return the defense characteristics of this station.
 VectorFleetID getDockedFleets()
          Returns the fleets that are docked at this station.
 StationID getID()
          Returns the Station's ID.
static StationID getID(java.lang.String in_name)
          Returns ID of station with the given name.
 Index getIndex()
          See getID() in the subclasses for a typed version.
abstract  Location getLocation()
          Returns the location of this station.
 VectorModuleID getModules()
          Get the list of modules at this station.
 java.lang.String getName()
          Returns the name of the station.
 CivID getOwner()
          Returns the ID of the owner of the station.
abstract  void getSpecificTableInfo(CivID civID, DisplayReturn DR)
          This function allows additional values to be presented in the station table.
 void setName(java.lang.String new_name)
          Sets the name of the station that should be shown in the UI.
 void setOwner(CivID newOwner)
          Sets the owner of the station.
abstract  VectorDisplayReturn specificDisplay()
          Specific display information about this object.
 
Methods inherited from class org.gjt.universe.DBItem
specificDisplayDebug
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

currentID

private static StationID currentID

ID

private StationID ID

name

private java.lang.String name

owner

private CivID owner

modules

private VectorModuleID modules
Constructor Detail

StationBase

protected StationBase(CivID civID,
                      java.lang.String in_name)
Standard constructor for this base object.

Parameters:
civID - The ID of the civ who will own the station.
in_name - Name of station.

StationBase

protected StationBase()
Default constructor for StationUndefined object.

Method Detail

announceCreation

protected void announceCreation()
This method announces, via a notification posted on the default notification center that the instance exists. Final subclasses should call this as the last step of their constructors, when they are ready to be accessed. This is done this way rather than simply performing the announcement in one of the constructors of StationBase in order to allow the subclass to ensure that it is in a sane state before being accessed by observers.


getID

public final StationID getID()
Returns the Station's ID.

Returns:
ID of station.

getIndex

public final Index getIndex()
Description copied from class: DBItem
See getID() in the subclasses for a typed version.

Specified by:
getIndex in class DBItem

getID

public static StationID getID(java.lang.String in_name)
Returns ID of station with the given name.

Parameters:
in_name - Name of station to get ID for.
Returns:
ID of requested station.

getName

public final java.lang.String getName()
Returns the name of the station.

Specified by:
getName in class DBItem
Returns:
Name of station.

setName

public void setName(java.lang.String new_name)
Sets the name of the station that should be shown in the UI. The change will be announced via a NAME_CHANGED StationNotification.


getOwner

public final CivID getOwner()
Returns the ID of the owner of the station.

Overrides:
getOwner in class DBItem
Returns:
Owner of station

setOwner

public final void setOwner(CivID newOwner)
Sets the owner of the station.

Parameters:
newOwner - The new owner of this station.

addModule

public final void addModule(ModuleID MID)
Adds a module to the list of modules for this station.

Parameters:
MID - New module to add to the station.

destroyModule

public final void destroyModule(ModuleID MID)
This method removes the module with the given ID from the station. If this leaves the station with no modules, the station itself will cease to exist. The reduction in modules will be announced via a MODULES_CHANGED StationNotificaiton, unless the station is eliminated, in which case an ELIMINATED notificaiton will be posted instead.

Parameters:
MID - The unique ID of the module to be removed from the station.

getModules

public final VectorModuleID getModules()
Get the list of modules at this station.

Returns:
list of modules at this station.

getLocation

public abstract Location getLocation()
Returns the location of this station.

Overrides:
getLocation in class DBItem
Returns:
The location of this station.

getDockedFleets

public final VectorFleetID getDockedFleets()
Returns the fleets that are docked at this station.

Returns:
The vector of ID's for docked fleets at this station.

getAttack

public abstract AttackBase getAttack()
Return the attack characteristics of this station.


getDefense

public abstract DefenseBase getDefense()
Return the defense characteristics of this station.


specificDisplay

public abstract VectorDisplayReturn specificDisplay()
Specific display information about this object.

Returns:
list of display information.

getSpecificTableInfo

public abstract void getSpecificTableInfo(CivID civID,
                                          DisplayReturn DR)
This function allows additional values to be presented in the station table.

Parameters:
DR - DisplayReturn to modify
civID - Civ who is "viewing" this station.


Copyright © 2001 Universe Dev Team All Rights Reserved.