com.swath
Class Identity

java.lang.Object
  extended bycom.swath.Info
      extended bycom.swath.Identity
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
Corporation, Trader

public abstract class Identity
extends Info
implements java.lang.Cloneable

This class represents an identity and is either a trader or a corporation.

Since:
SWATH 1.5
See Also:
Trader, Corporation

Method Summary
abstract  java.lang.Object clone()
           
abstract  boolean equals(java.lang.Object obj)
          Compares this identity to another one.
 Corporation getCorporation()
          Returns the corporation.
 Trader getTrader()
          Returns the trader.
 boolean isCorporation()
          Indicates if the identity is a corporation or not.
 boolean isRealPlayer()
          Indicates if this is a real player or a computer controlled trader.
 boolean isTrader()
          Indicates if the identity is a trader or not.
 boolean isUnknown()
          Indicates if the identity is unknown or not.
 boolean isYou()
          Indicates if this is you or not.
 boolean isYourCorporation()
          Indicates if this is your corporation or not.
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

equals

public abstract boolean equals(java.lang.Object obj)
Compares this identity to another one.

Parameters:
obj - The other identity.
Returns:
true if they are equal, otherwise false.
Since:
SWATH 1.5
See Also:
isYou(), isYourCorporation()

clone

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

isTrader

public boolean isTrader()
Indicates if the identity is a trader or not.

Returns:
true if it is a trader, otherwise false.
Since:
SWATH 1.5
See Also:
isCorporation(), isUnknown(), getTrader()

isCorporation

public boolean isCorporation()
Indicates if the identity is a corporation or not.

Returns:
true if it is a corporation, otherwise false.
Since:
SWATH 1.5
See Also:
isTrader(), isUnknown(), getCorporation()

isUnknown

public boolean isUnknown()
Indicates if the identity is unknown or not.

Returns:
true if it is unknown, otherwise false.
Since:
SWATH 1.5
See Also:
isTrader(), isCorporation()

getTrader

public Trader getTrader()
Returns the trader. (Only valid if the identity is a trader)

Returns:
The trader or null if the identity is not a trader.
Since:
SWATH 1.5
See Also:
isTrader(), getCorporation()

getCorporation

public Corporation getCorporation()
Returns the corporation. (Only valid if the identity is a corporation)

Returns:
The corporation or null if the identity is not a corporation.
Since:
SWATH 1.5
See Also:
isCorporation(), getTrader()

isYou

public boolean isYou()
Indicates if this is you or not.

Returns:
true if it is you, otherwise false.
Since:
SWATH 1.5
See Also:
isRealPlayer(), isYourCorporation(), equals(Object)

isRealPlayer

public boolean isRealPlayer()
Indicates if this is a real player or a computer controlled trader.

Returns:
true if this is a real player, otherwise false.
Since:
SWATH 1.6
See Also:
isYou(), isYourCorporation(), equals(Object)

isYourCorporation

public boolean isYourCorporation()
Indicates if this is your corporation or not.

Returns:
true if it is your corporation, otherwise false.
Since:
SWATH 1.5
See Also:
isYou(), isRealPlayer(), equals(Object)