com.swath
Class Ship

java.lang.Object
  extended bycom.swath.Info
      extended bycom.swath.Ship

public final class Ship
extends Info

This class represents a ship in TW.

Since:
SWATH 1.3

Field Summary
static int NO_TWD
          The ship has no TransWarp drive.
static int ONE_SHIP_TWD
          The ship has a TransWarp drive for one ship.
static int TWO_SHIP_TWD
          The ship has a TransWarp drive for two ships.
 
Method Summary
 int armidMines()
          Gets the number of armid mines on the ship.
 int atomicDevices()
          Gets the number of atomic detonators on the ship.
 int beacons()
          Gets the number of marker beacons on the ship.
 java.lang.String brand()
          Gets the brand of the ship.
 int cloakingDevices()
          Gets the number of cloaking devices on the ship.
 java.lang.Object clone()
           
 int colonists()
          Gets total number of holds with colonists.
 int corbomite()
          Gets the number of corbomite transducers on the ship.
 java.util.Date dateBuilt()
          Gets the date when the ship was built.
 void display()
          Displays this ship in the terminal window.
 void dump()
          Dumps the ship info in the terminal window.
 int emptyHolds()
          Gets total number of empty holds on the ship.
 boolean equals(java.lang.Object obj)
           
 int equipment()
          Gets total number of holds with equipment.
 int etherProbes()
          Gets the number of subspace ether probes on the ship.
 int fighters()
          Gets the number of fighters on the ship.
 int fuel()
          Gets total number of holds with fuel ore.
 int genesisTorpedos()
          Gets the number of genesis torpedos on the ship.
 boolean hasDensityScanner()
          Indicates if the ship has a density scanner or not.
 boolean hasHoloScanner()
          Indicates if the ship has a holographic scanner or not.
 boolean hasInterdictor()
          Indicates if the ship has an interdictor generator or not.
 boolean hasPlanetScanner()
          Indicates if the ship has a planet scanner or not.
 boolean hasPsychicProbe()
          Indicates if the ship has a psychic probe or not.
 int holds()
          Gets total number of holds on the ship.
 int id()
          Gets the ship identification number.
 boolean isCorpShip()
          Indicates if the ship is corporate or personal.
 boolean isDockedAtPort()
          Indicates if the ship is docked at the port or not.
 boolean isInterdictorActive()
          Indicates if the ship's interdictor generator is active or not.
 java.util.Date lastUpdate()
          Gets the timestamp when the ship information was last updated.
 int limpetMines()
          Gets the number of limpet mines on the ship.
 int mineDisruptors()
          Gets the number of mine disruptors on the ship.
 java.lang.String name()
          Gets the name of the ship.
 int oneShipTransWarpRange()
          Gets the current range of a one ship TransWarp.
 Planet onPlanet()
          If the ship has landed on a planet, this method will return it.
 int organics()
          Gets total number of holds with organics.
 Identity owner()
          Gets the current owner of the ship.
 int photonMissiles()
          Gets the number of photon missiles on the ship.
 int sector()
          Gets the sector number where the ship is currently located.
 int shields()
          Gets the number of shields on the ship.
 ShipCategory shipCategory()
          Gets the ship category.
 java.lang.String toString()
           
 Ship towingShip()
          Indicates if the ship is towing another ship or not.
 int transWarpDrive()
          Indicates if the ship has a TransWarp drive or not and gets the type of TransWarp drive if the ship has one.
 int turns2warp()
          Gets the current number of turns the ship needs to warp.
 int twoShipTransWarpRange()
          Gets the current range of a two ship TransWarp.
 java.lang.String type()
          Gets the type of the ship.
 Trader user()
          Gets the current user of the ship.
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NO_TWD

public static final int NO_TWD
The ship has no TransWarp drive.

See Also:
Constant Field Values

ONE_SHIP_TWD

public static final int ONE_SHIP_TWD
The ship has a TransWarp drive for one ship.

See Also:
Constant Field Values

TWO_SHIP_TWD

public static final int TWO_SHIP_TWD
The ship has a TransWarp drive for two ships.

See Also:
Constant Field Values
Method Detail

toString

public java.lang.String toString()

equals

public boolean equals(java.lang.Object obj)

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Throws:
java.lang.CloneNotSupportedException

id

public int id()
Gets the ship identification number.

Returns:
The ship id.
Since:
SWATH 1.3

lastUpdate

public java.util.Date lastUpdate()
                          throws java.lang.Exception
Gets the timestamp when the ship information was last updated.

Returns:
The last update or null if never updated.
Throws:
java.lang.Exception
Since:
SWATH 1.3

name

public java.lang.String name()
                      throws java.lang.Exception
Gets the name of the ship.

Returns:
The ship name.
Throws:
java.lang.Exception
Since:
SWATH 1.3

type

public java.lang.String type()
                      throws java.lang.Exception
Gets the type of the ship.

Returns:
The ship type.
Throws:
java.lang.Exception
Since:
SWATH 1.3

shipCategory

public ShipCategory shipCategory()
                          throws java.lang.Exception
Gets the ship category.

Returns:
The ship category or null if not known.
Throws:
java.lang.Exception
Since:
SWATH 1.6

brand

public java.lang.String brand()
                       throws java.lang.Exception
Gets the brand of the ship.

Returns:
The ship brand.
Throws:
java.lang.Exception
Since:
SWATH 1.3

dateBuilt

public java.util.Date dateBuilt()
                         throws java.lang.Exception
Gets the date when the ship was built.

Returns:
The date when ship was built or null if not known.
Throws:
java.lang.Exception
Since:
SWATH 1.3

sector

public int sector()
           throws java.lang.Exception
Gets the sector number where the ship is currently located.

Returns:
The current location or 0 if unknown.
Throws:
java.lang.Exception
Since:
SWATH 1.3

user

public Trader user()
            throws java.lang.Exception
Gets the current user of the ship.

Returns:
The ship user.
Throws:
java.lang.Exception
Since:
SWATH 1.3
See Also:
owner(), Trader

owner

public Identity owner()
               throws java.lang.Exception
Gets the current owner of the ship.

Returns:
The ship owner.
Throws:
java.lang.Exception
Since:
SWATH 1.3
See Also:
user(), isCorpShip(), Identity, Trader, Corporation

isCorpShip

public boolean isCorpShip()
                   throws java.lang.Exception
Indicates if the ship is corporate or personal. If the owner() method returns an unknown identity, the return value of this method is not valid.

Returns:
true if the ship is corporate, otherwise false.
Throws:
java.lang.Exception
Since:
SWATH 1.3
See Also:
owner()

towingShip

public Ship towingShip()
                throws java.lang.Exception
Indicates if the ship is towing another ship or not. If it is towing, the ship in tow is returned.

Returns:
The ship in tow or null if none.
Throws:
java.lang.Exception
Since:
SWATH 1.3

holds

public int holds()
          throws java.lang.Exception
Gets total number of holds on the ship.

Returns:
Ship holds.
Throws:
java.lang.Exception
Since:
SWATH 1.3

fuel

public int fuel()
         throws java.lang.Exception
Gets total number of holds with fuel ore.

Returns:
Holds with fuel ore.
Throws:
java.lang.Exception
Since:
SWATH 1.3

organics

public int organics()
             throws java.lang.Exception
Gets total number of holds with organics.

Returns:
Holds with organics.
Throws:
java.lang.Exception
Since:
SWATH 1.3

equipment

public int equipment()
              throws java.lang.Exception
Gets total number of holds with equipment.

Returns:
Holds with equipment.
Throws:
java.lang.Exception
Since:
SWATH 1.3

colonists

public int colonists()
              throws java.lang.Exception
Gets total number of holds with colonists.

Returns:
Holds with colonists.
Throws:
java.lang.Exception
Since:
SWATH 1.3

emptyHolds

public int emptyHolds()
               throws java.lang.Exception
Gets total number of empty holds on the ship.

Returns:
Empty holds.
Throws:
java.lang.Exception
Since:
SWATH 1.3

fighters

public int fighters()
             throws java.lang.Exception
Gets the number of fighters on the ship.

Returns:
The number of fighters.
Throws:
java.lang.Exception
Since:
SWATH 1.3

shields

public int shields()
            throws java.lang.Exception
Gets the number of shields on the ship.

Returns:
The number of shields.
Throws:
java.lang.Exception
Since:
SWATH 1.3

turns2warp

public int turns2warp()
               throws java.lang.Exception
Gets the current number of turns the ship needs to warp.

Returns:
The number of turns to warp.
Throws:
java.lang.Exception
Since:
SWATH 1.3

transWarpDrive

public int transWarpDrive()
                   throws java.lang.Exception
Indicates if the ship has a TransWarp drive or not and gets the type of TransWarp drive if the ship has one.

Returns:
The type of TransWarp drive or NO_TWD if none.
Throws:
java.lang.Exception
Since:
SWATH 1.3
See Also:
oneShipTransWarpRange(), twoShipTransWarpRange(), NO_TWD, ONE_SHIP_TWD, TWO_SHIP_TWD

oneShipTransWarpRange

public int oneShipTransWarpRange()
                          throws java.lang.Exception
Gets the current range of a one ship TransWarp. Only valid if the ship has ONE_SHIP_TWD or TWO_SHIP_TWD.

Returns:
The number of hops.
Throws:
java.lang.Exception
Since:
SWATH 1.3
See Also:
transWarpDrive(), twoShipTransWarpRange()

twoShipTransWarpRange

public int twoShipTransWarpRange()
                          throws java.lang.Exception
Gets the current range of a two ship TransWarp. Only valid if the ship has TWO_SHIP_TWD.

Returns:
The number of hops.
Throws:
java.lang.Exception
Since:
SWATH 1.3
See Also:
transWarpDrive(), oneShipTransWarpRange()

beacons

public int beacons()
            throws java.lang.Exception
Gets the number of marker beacons on the ship.

Returns:
Number of beacons.
Throws:
java.lang.Exception
Since:
SWATH 1.3

etherProbes

public int etherProbes()
                throws java.lang.Exception
Gets the number of subspace ether probes on the ship.

Returns:
Number of probes.
Throws:
java.lang.Exception
Since:
SWATH 1.3

armidMines

public int armidMines()
               throws java.lang.Exception
Gets the number of armid mines on the ship.

Returns:
Number of mines.
Throws:
java.lang.Exception
Since:
SWATH 1.3

limpetMines

public int limpetMines()
                throws java.lang.Exception
Gets the number of limpet mines on the ship.

Returns:
Number of mines.
Throws:
java.lang.Exception
Since:
SWATH 1.3

mineDisruptors

public int mineDisruptors()
                   throws java.lang.Exception
Gets the number of mine disruptors on the ship.

Returns:
Number of disruptors.
Throws:
java.lang.Exception
Since:
SWATH 1.3

genesisTorpedos

public int genesisTorpedos()
                    throws java.lang.Exception
Gets the number of genesis torpedos on the ship.

Returns:
Number of torpedos.
Throws:
java.lang.Exception
Since:
SWATH 1.3

atomicDevices

public int atomicDevices()
                  throws java.lang.Exception
Gets the number of atomic detonators on the ship.

Returns:
Number of detonators.
Throws:
java.lang.Exception
Since:
SWATH 1.3

photonMissiles

public int photonMissiles()
                   throws java.lang.Exception
Gets the number of photon missiles on the ship.

Returns:
Number of photons.
Throws:
java.lang.Exception
Since:
SWATH 1.3

corbomite

public int corbomite()
              throws java.lang.Exception
Gets the number of corbomite transducers on the ship.

Returns:
Number of transducers.
Throws:
java.lang.Exception
Since:
SWATH 1.3

cloakingDevices

public int cloakingDevices()
                    throws java.lang.Exception
Gets the number of cloaking devices on the ship.

Returns:
Number of devices.
Throws:
java.lang.Exception
Since:
SWATH 1.3

hasPsychicProbe

public boolean hasPsychicProbe()
                        throws java.lang.Exception
Indicates if the ship has a psychic probe or not.

Returns:
true if the ship has a psychic probe, otherwise false.
Throws:
java.lang.Exception
Since:
SWATH 1.3

hasDensityScanner

public boolean hasDensityScanner()
                          throws java.lang.Exception
Indicates if the ship has a density scanner or not.

Returns:
true if the ship has a density scanner, otherwise false.
Throws:
java.lang.Exception
Since:
SWATH 1.3

hasHoloScanner

public boolean hasHoloScanner()
                       throws java.lang.Exception
Indicates if the ship has a holographic scanner or not.

Returns:
true if the ship has a holographic scanner, otherwise false.
Throws:
java.lang.Exception
Since:
SWATH 1.3

hasPlanetScanner

public boolean hasPlanetScanner()
                         throws java.lang.Exception
Indicates if the ship has a planet scanner or not.

Returns:
true if the ship has a planet scanner, otherwise false.
Throws:
java.lang.Exception
Since:
SWATH 1.3

hasInterdictor

public boolean hasInterdictor()
                       throws java.lang.Exception
Indicates if the ship has an interdictor generator or not.

Returns:
true if the ship has an interdictor generator, otherwise false.
Throws:
java.lang.Exception
Since:
SWATH 1.3
See Also:
isInterdictorActive()

isInterdictorActive

public boolean isInterdictorActive()
                            throws java.lang.Exception
Indicates if the ship's interdictor generator is active or not. Only valid if the ship has an interdictor generator.

Returns:
true if the interdictor generator is active, otherwise false.
Throws:
java.lang.Exception
Since:
SWATH 1.3
See Also:
hasInterdictor()

isDockedAtPort

public boolean isDockedAtPort()
                       throws java.lang.Exception
Indicates if the ship is docked at the port or not.

Returns:
true if the ship is docked, otherwise false.
Throws:
java.lang.Exception
Since:
SWATH 1.7

onPlanet

public Planet onPlanet()
                throws java.lang.Exception
If the ship has landed on a planet, this method will return it.

Returns:
The planet or null if not landed or unknown.
Throws:
java.lang.Exception
Since:
SWATH 1.7

display

public void display()
             throws java.lang.Exception
Displays this ship in the terminal window.

Throws:
java.lang.Exception
Since:
SWATH 1.4
See Also:
dump()

dump

public void dump()
          throws java.lang.Exception
Dumps the ship info in the terminal window.

Throws:
java.lang.Exception
Since:
SWATH 1.3
See Also:
display()