com.swath
Class Sector

java.lang.Object
  extended bycom.swath.Info
      extended bycom.swath.Sector
All Implemented Interfaces:
java.lang.Cloneable

public final class Sector
extends Info
implements java.lang.Cloneable

This class represents a sector in TW.

Since:
SWATH 1.3

Field Summary
static int BOTH_WAY
          Indicates a warp that can be used both ways.
static int BUYING
          The port is buying this product.
static int NO_PORT
          There is no port in this sector.
static int ONE_WAY
          Indicates a one way warp.
static int PORT_AVAILABLE
          There is a port in this sector, ready to use.
static int PORT_BLOCKED
          There seems to be a blocked port in this sector.
static int PORT_DESTROYED
          Warning, there is a destroyed port in this sector.
static int PORT_UNDER_CONSTRUCTION
          There is a port under construction in this sector.
static int SELLING
          The port is selling this product.
 
Method Summary
 boolean anomaly()
          Indicates if there is an anomaly in the sector or not.
 int armidMines()
          Gets the number of armid mines in the sector.
 Identity armidOwner()
          Gets the owner of the armid mines in this sector.
 int[] backdoorSectors()
          Gets the backdoor sectors for this sector (if any).
 java.lang.String beaconMessage()
          Indicates if there is a beacon in the sector or not.
 Bubble[] bubbles()
          Gets all the bubbles that the sector is part of.
 java.util.Date busted()
          Indicates if you are busted at the port in this sector or not.
 java.lang.Object clone()
           
 int density()
          Gets the density for the sector.
 void display()
          Displays this sector in the terminal window.
 void dump()
          Dumps the sector info in the terminal window.
 boolean equals(java.lang.Object obj)
           
 int fighters()
          Gets the number of fighters in this sector.
 Identity ftrDestroyed()
          Indicates if your fighters in this sector has been destroyed and if so, who did destroy them.
 Identity ftrOwner()
          Gets the owner of the fighters in this sector.
 java.util.Date ftrTimestamp()
          Gets the timestamp when the fighters were placed or first discovered.
 int ftrType()
          Gets the type of fighters in this sector.
 boolean isAvoided()
          Indicates if the sector is avoided or not.
 boolean isEmpty()
          Indicates if the sector is empty or not.
 boolean isFedSpace()
          Indicates if the sector is located in FedSpace or not.
 boolean isStarDock()
          Indicates if the StarDock is located in this sector or not.
 boolean isUnexplored()
          Indicates if the sector is unexplored or not.
 boolean isVisited()
          Indicates if the sector has been visited or not.
 java.util.Date lastPortUpdate()
          Gets the timestamp when the port information was last updated.
 java.util.Date lastSectorUpdate()
          Gets the timestamp when the sector information was last updated.
 int limpetMines()
          Gets the number of limpet mines in the sector.
 Identity limpetOwner()
          Gets the owner of the limpet mines in this sector.
 int navHaz()
          Gets the navigational hazard for the sector (0-100%).
 int[] oneWays()
          Indicates if a warp sector is one-way or not.
 boolean partOfMajorSpaceLane()
          Indicates if the sector is part of a major space lane or not.
 Planet[] planets()
          Gets all the planets in the sector.
 int[] portAmounts()
          Gets the amount of product available at the port for each product type (Fuel Ore, Organics and Equipment).
 int portClass()
          Gets the port class.
 int portConstructionStatus()
          Gets the current construction status of the port.
 java.lang.String portDockingLog()
          Gets the name of the last ship that docked at the port.
 java.util.Date portDockingTimestamp()
          Gets the timestamp when the last ship docked at the port.
 int[] portInfo()
          Gets the port buy/sell information for each product type (Fuel Ore, Organics and Equipment).
 java.lang.String portName()
          Gets the name of the port in the sector.
 int[] portPercentages()
          Gets the amount of product available at the port in percentage of the maximal amount for each product type (Fuel Ore, Organics and Equipment).
 int portStatus()
          Gets the sector port status.
 int sector()
          Gets the sector number.
 java.lang.String sectorNote()
          Gets the sector note.
 void setSectorNote(java.lang.String note)
          Sets the sector note.
 Ship[] ships()
          Gets all the unmanned ships in the sector.
 java.lang.String spaceName()
          Gets the name of the space that the sector occupies.
 int status()
          Indicates if the sector is friendly, neutral or hostile to you.
 java.lang.String toString()
           
 Trader[] traders()
          Gets all the traders in the sector.
 int warps()
          Gets the number of warps from this sector.
 int[] warpSectors()
          Gets the sectors you can warp to from this sector.
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NO_PORT

public static final int NO_PORT
There is no port in this sector.

See Also:
Constant Field Values

PORT_AVAILABLE

public static final int PORT_AVAILABLE
There is a port in this sector, ready to use.

See Also:
Constant Field Values

PORT_UNDER_CONSTRUCTION

public static final int PORT_UNDER_CONSTRUCTION
There is a port under construction in this sector.

See Also:
Constant Field Values

PORT_DESTROYED

public static final int PORT_DESTROYED
Warning, there is a destroyed port in this sector.

See Also:
Constant Field Values

PORT_BLOCKED

public static final int PORT_BLOCKED
There seems to be a blocked port in this sector.

See Also:
Constant Field Values

BUYING

public static final int BUYING
The port is buying this product.

See Also:
Constant Field Values

SELLING

public static final int SELLING
The port is selling this product.

See Also:
Constant Field Values

ONE_WAY

public static final int ONE_WAY
Indicates a one way warp.

See Also:
Constant Field Values

BOTH_WAY

public static final int BOTH_WAY
Indicates a warp that can be used both ways.

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

sector

public int sector()
Gets the sector number.

Returns:
The sector number.
Since:
SWATH 1.3

lastSectorUpdate

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

Returns:
The last sector update or null if never updated.
Throws:
java.lang.Exception
Since:
SWATH 1.3
See Also:
lastPortUpdate()

lastPortUpdate

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

Returns:
The last port update or null if never updated.
Throws:
java.lang.Exception
Since:
SWATH 1.3
See Also:
lastSectorUpdate()

status

public int status()
           throws java.lang.Exception
Indicates if the sector is friendly, neutral or hostile to you.

Returns:
The current sector status.
Throws:
java.lang.Exception
Since:
SWATH 1.5
See Also:
Swath.FRIENDLY, Swath.NEUTRAL, Swath.HOSTILE

isEmpty

public boolean isEmpty()
                throws java.lang.Exception
Indicates if the sector is empty or not.

Returns:
true if the sector is empty, otherwise false.
Throws:
java.lang.Exception
Since:
SWATH 1.3

isUnexplored

public boolean isUnexplored()
                     throws java.lang.Exception
Indicates if the sector is unexplored or not. If you have imported information about a sector, the sector is not unexplored in SWATH but can still be unexplored in the game until you have visited the sector.

Returns:
true if the sector is unexplored, otherwise false.
Throws:
java.lang.Exception
Since:
SWATH 1.3
See Also:
isVisited()

isVisited

public boolean isVisited()
                  throws java.lang.Exception
Indicates if the sector has been visited or not. A sector is visited if you have been in the sector or if one of your ether probes has passed through the sector.

Returns:
true if the sector has been visited, otherwise false.
Throws:
java.lang.Exception
Since:
SWATH 1.5
See Also:
isUnexplored()

isStarDock

public boolean isStarDock()
                   throws java.lang.Exception
Indicates if the StarDock is located in this sector or not.

Returns:
true if the StarDock is here, otherwise false.
Throws:
java.lang.Exception
Since:
SWATH 1.7
See Also:
isFedSpace(), partOfMajorSpaceLane()

isFedSpace

public boolean isFedSpace()
                   throws java.lang.Exception
Indicates if the sector is located in FedSpace or not.

Returns:
true if the sector is in FedSpace, otherwise false.
Throws:
java.lang.Exception
Since:
SWATH 1.7
See Also:
isStarDock(), partOfMajorSpaceLane()

partOfMajorSpaceLane

public boolean partOfMajorSpaceLane()
                             throws java.lang.Exception
Indicates if the sector is part of a major space lane or not. Major space lanes connects the StarDock with all class 0 ports.

Returns:
true if the sector is part of a major space lane, otherwise false.
Throws:
java.lang.Exception
Since:
SWATH 1.5
See Also:
isStarDock(), isFedSpace()

spaceName

public java.lang.String spaceName()
                           throws java.lang.Exception
Gets the name of the space that the sector occupies.

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

portStatus

public int portStatus()
               throws java.lang.Exception
Gets the sector port status.

Returns:
The port status.
Throws:
java.lang.Exception
Since:
SWATH 1.3
See Also:
NO_PORT, PORT_AVAILABLE, PORT_UNDER_CONSTRUCTION, PORT_DESTROYED, PORT_BLOCKED

portName

public java.lang.String portName()
                          throws java.lang.Exception
Gets the name of the port in the sector. The return value is only valid if the sector port status is PORT_AVAILABLE or PORT_UNDER_CONSTRUCTION.

Returns:
The port name.
Throws:
java.lang.Exception
Since:
SWATH 1.3
See Also:
portStatus()

portClass

public int portClass()
              throws java.lang.Exception
Gets the port class. The return value is only valid if the sector port status is PORT_AVAILABLE or PORT_UNDER_CONSTRUCTION.

Returns:
The port class.
Throws:
java.lang.Exception
Since:
SWATH 1.3
See Also:
portStatus()

portConstructionStatus

public int portConstructionStatus()
                           throws java.lang.Exception
Gets the current construction status of the port.

Returns:
The number of days left of the port construction, or 0 if the port is not under construction.
Throws:
java.lang.Exception
Since:
SWATH 1.6.2
See Also:
portStatus()

portDockingLog

public java.lang.String portDockingLog()
                                throws java.lang.Exception
Gets the name of the last ship that docked at the port. The return value is only valid if the sector port status is PORT_AVAILABLE.

Returns:
The ship name or null if no ship docked or if it is unknown.
Throws:
java.lang.Exception
Since:
SWATH 1.6.2
See Also:
portDockingTimestamp(), portStatus()

portDockingTimestamp

public java.util.Date portDockingTimestamp()
                                    throws java.lang.Exception
Gets the timestamp when the last ship docked at the port. The return value is only valid if the sector port status is PORT_AVAILABLE.

Returns:
The timestamp or null if not known.
Throws:
java.lang.Exception
Since:
SWATH 1.6.2
See Also:
portDockingLog(), portStatus()

portInfo

public int[] portInfo()
               throws java.lang.Exception
Gets the port buy/sell information for each product type (Fuel Ore, Organics and Equipment). The return value is only valid if the sector port status is PORT_AVAILABLE or PORT_UNDER_CONSTRUCTION.

Returns:
An array with a BUYING or a SELLING indicator for each product.
Throws:
java.lang.Exception
Since:
SWATH 1.3
See Also:
BUYING, SELLING, Swath.FUEL_ORE, Swath.ORGANICS, Swath.EQUIPMENT, portStatus()

portAmounts

public int[] portAmounts()
                  throws java.lang.Exception
Gets the amount of product available at the port for each product type (Fuel Ore, Organics and Equipment). The amount is UNKNOWN if not known. The return value is only valid if the sector port status is PORT_AVAILABLE.

Returns:
An array with the three product amounts.
Throws:
java.lang.Exception
Since:
SWATH 1.3
See Also:
Swath.FUEL_ORE, Swath.ORGANICS, Swath.EQUIPMENT, Swath.UNKNOWN, portStatus(), portPercentages()

portPercentages

public int[] portPercentages()
                      throws java.lang.Exception
Gets the amount of product available at the port in percentage of the maximal amount for each product type (Fuel Ore, Organics and Equipment). The percentage is UNKNOWN if not known. The return value is only valid if the sector port status is PORT_AVAILABLE.

Returns:
An array with the three product percentages.
Throws:
java.lang.Exception
Since:
SWATH 1.3
See Also:
Swath.FUEL_ORE, Swath.ORGANICS, Swath.EQUIPMENT, Swath.UNKNOWN, portStatus(), portAmounts()

busted

public java.util.Date busted()
                      throws java.lang.Exception
Indicates if you are busted at the port in this sector or not. The return value is only valid if the sector port status is PORT_AVAILABLE.

Returns:
The timestamp when busted or null if not busted.
Throws:
java.lang.Exception
Since:
SWATH 1.3
See Also:
portStatus()

warps

public int warps()
          throws java.lang.Exception
Gets the number of warps from this sector.

Returns:
The number of warps.
Throws:
java.lang.Exception
Since:
SWATH 1.3
See Also:
warpSectors(), oneWays(), backdoorSectors()

warpSectors

public int[] warpSectors()
                  throws java.lang.Exception
Gets the sectors you can warp to from this sector.

Returns:
An array with the warp sectors.
Throws:
java.lang.Exception
Since:
SWATH 1.3
See Also:
warps(), oneWays(), backdoorSectors()

oneWays

public int[] oneWays()
              throws java.lang.Exception
Indicates if a warp sector is one-way or not.

Returns:
An array with a ONE_WAY or a BOTH_WAY indicator for each warp sector.
Throws:
java.lang.Exception
Since:
SWATH 1.3
See Also:
warps(), warpSectors(), backdoorSectors(), ONE_WAY, BOTH_WAY

backdoorSectors

public int[] backdoorSectors()
                      throws java.lang.Exception
Gets the backdoor sectors for this sector (if any). A backdoor sector is a sector that lead to this sector, but there is no way back (that is known).

Returns:
An array with the backdoor sectors.
Throws:
java.lang.Exception
Since:
SWATH 1.6.2
See Also:
warpSectors()

fighters

public int fighters()
             throws java.lang.Exception
Gets the number of fighters in this sector.

Returns:
The number of fighters.
Throws:
java.lang.Exception
Since:
SWATH 1.3
See Also:
ftrOwner(), ftrType(), ftrTimestamp(), ftrDestroyed()

ftrOwner

public Identity ftrOwner()
                  throws java.lang.Exception
Gets the owner of the fighters in this sector. The return value is valid only if there are fighters in the sector.

Returns:
The owner of the fighters.
Throws:
java.lang.Exception
Since:
SWATH 1.3
See Also:
fighters(), Identity, Trader, Corporation

ftrType

public int ftrType()
            throws java.lang.Exception
Gets the type of fighters in this sector. The return value is valid only if there are fighters in the sector.

Returns:
The type of fighters or -1 if not known.
Throws:
java.lang.Exception
Since:
SWATH 1.3
See Also:
fighters(), Swath.TOLL_FTRS, Swath.DEFENSIVE_FTRS, Swath.OFFENSIVE_FTRS, Swath.MERCHENARY_FTRS

ftrTimestamp

public java.util.Date ftrTimestamp()
                            throws java.lang.Exception
Gets the timestamp when the fighters were placed or first discovered. The return value is valid only if there are fighters in the sector.

Returns:
The timestamp or null if not known.
Throws:
java.lang.Exception
Since:
SWATH 1.6.2
See Also:
fighters()

ftrDestroyed

public Identity ftrDestroyed()
                      throws java.lang.Exception
Indicates if your fighters in this sector has been destroyed and if so, who did destroy them.

Returns:
The trader or corporation that destroyed your fighters or null if no fighters has been destroyed.
Throws:
java.lang.Exception
Since:
SWATH 1.7
See Also:
fighters(), Identity, Trader, Corporation

armidMines

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

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

armidOwner

public Identity armidOwner()
                    throws java.lang.Exception
Gets the owner of the armid mines in this sector. The return value is valid only if there are armid mines in the sector.

Returns:
The owner of the armid mines.
Throws:
java.lang.Exception
Since:
SWATH 1.5
See Also:
armidMines(), Identity, Trader, Corporation

limpetMines

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

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

limpetOwner

public Identity limpetOwner()
                     throws java.lang.Exception
Gets the owner of the limpet mines in this sector. The return value is valid only if there are limpet mines in the sector.

Returns:
The owner of the limpet mines.
Throws:
java.lang.Exception
Since:
SWATH 1.5
See Also:
limpetMines(), Identity, Trader, Corporation

density

public int density()
            throws java.lang.Exception
Gets the density for the sector.

Returns:
The density.
Throws:
java.lang.Exception
Since:
SWATH 1.3

anomaly

public boolean anomaly()
                throws java.lang.Exception
Indicates if there is an anomaly in the sector or not.

Returns:
true if there is an anomaly, otherwise false.
Throws:
java.lang.Exception
Since:
SWATH 1.3

navHaz

public int navHaz()
           throws java.lang.Exception
Gets the navigational hazard for the sector (0-100%).

Returns:
The navigational hazard percentage.
Throws:
java.lang.Exception
Since:
SWATH 1.3

isAvoided

public boolean isAvoided()
                  throws java.lang.Exception
Indicates if the sector is avoided or not.

Returns:
true if it is avoided, otherwise false.
Throws:
java.lang.Exception
Since:
SWATH 1.6.5

beaconMessage

public java.lang.String beaconMessage()
                               throws java.lang.Exception
Indicates if there is a beacon in the sector or not.

Returns:
The beacon message or null if there is no beacon.
Throws:
java.lang.Exception
Since:
SWATH 1.3

sectorNote

public java.lang.String sectorNote()
                            throws java.lang.Exception
Gets the sector note.

Returns:
The sector note or null if none.
Throws:
java.lang.Exception
Since:
SWATH 1.3
See Also:
setSectorNote(java.lang.String)

setSectorNote

public void setSectorNote(java.lang.String note)
                   throws java.lang.Exception
Sets the sector note. The maximum size is 68 characters.

Parameters:
note - The new sector note or null for none.
Throws:
java.lang.Exception
Since:
SWATH 1.6.5
See Also:
sectorNote()

planets

public Planet[] planets()
                 throws java.lang.Exception
Gets all the planets in the sector.

Returns:
An array with all the planets.
Throws:
java.lang.Exception
Since:
SWATH 1.5
See Also:
traders(), ships()

traders

public Trader[] traders()
                 throws java.lang.Exception
Gets all the traders in the sector.

Returns:
An array with all the traders.
Throws:
java.lang.Exception
Since:
SWATH 1.5
See Also:
planets(), ships()

ships

public Ship[] ships()
             throws java.lang.Exception
Gets all the unmanned ships in the sector.

Returns:
An array with all the ships.
Throws:
java.lang.Exception
Since:
SWATH 1.5
See Also:
planets(), traders()

bubbles

public Bubble[] bubbles()
                 throws java.lang.Exception
Gets all the bubbles that the sector is part of.

Returns:
An array with all the bubbles.
Throws:
java.lang.Exception
Since:
SWATH 1.6.2
See Also:
Swath.getBubbles(int)

display

public void display()
             throws java.lang.Exception
Displays this sector 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 sector info in the terminal window.

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