universe.common.database
Class Location

java.lang.Object
  |
  +--universe.common.database.Location
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public final class Location
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable

The Location class represents a "location" in the universe. For example, this location might be a coordinate in space or orbiting a planet or docked at a space station. The class LocationType is an enumrated type for this class. This class is immutable.

Version:
$Id: Location.java,v 1.5 2003/04/03 07:10:39 sstarkey Exp $
See Also:
LocationType, Serialized Form

Field Summary
 Coord coord
           
 GalaxyID galaxyid
           
 PlanetID planetid
           
 StationID stationid
           
 SystemID systemid
           
 LocationType type
           
 
Constructor Summary
Location()
          Default constructor - sets an undefined location object.
Location(Coord in_coord)
          Constructor that takes a Coord object.
Location(GalaxyID in_galaxy, Coord in_coord)
          Constructor that takes a Coord object.
Location(Location loc)
           
Location(PlanetID PID)
          Constructor that takes a PlanetID object representing orbiting the planet.
Location(PlanetID PID, boolean surface)
          Constructor that takes a PlanetID object and a boolean representing if the location is in orbit or on the surface.
Location(StationID BID)
          Constructor that takes a StationID object.
Location(SystemID SID)
          Constructor that takes a SystemID object.
 
Method Summary
 java.lang.Object clone()
           
 boolean equals(java.lang.Object ob)
           
 LocationType getType()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

type

public final LocationType type

coord

public final Coord coord

galaxyid

public final GalaxyID galaxyid

systemid

public final SystemID systemid

planetid

public final PlanetID planetid

stationid

public final StationID stationid
Constructor Detail

Location

public Location(Location loc)

Location

public Location()
Default constructor - sets an undefined location object.


Location

public Location(Coord in_coord)
Constructor that takes a Coord object.


Location

public Location(GalaxyID in_galaxy,
                Coord in_coord)
Constructor that takes a Coord object.


Location

public Location(PlanetID PID)
Constructor that takes a PlanetID object representing orbiting the planet.


Location

public Location(PlanetID PID,
                boolean surface)
Constructor that takes a PlanetID object and a boolean representing if the location is in orbit or on the surface.


Location

public Location(SystemID SID)
Constructor that takes a SystemID object. This location represents inside the system (orbiting the star.)


Location

public Location(StationID BID)
Constructor that takes a StationID object. This location represents a station docking.

Method Detail

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object

getType

public LocationType getType()

equals

public boolean equals(java.lang.Object ob)
Overrides:
equals in class java.lang.Object


Copyright © 2001 Universe Dev Team All Rights Reserved.