de.hagenah.diplomacy.map
Class SubProvince

java.lang.Object
  extended by de.hagenah.diplomacy.map.SubProvince
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable

public final class SubProvince
extends java.lang.Object
implements java.lang.Comparable, java.io.Serializable

The SubProvince class represents a subprovince of a province. E.g. has the province Bulgaria the three subprovinces east coast, south coast, and land.

See Also:
Serialized Form

Method Summary
 boolean canConvoy()
          Returns true if a unit in this subprovince can convoy an army
 boolean canMoveTo(SubProvince dest)
          Can a unit in this subprovince move to dest?
 boolean canSupport(Province dest)
          Can a unit support the province dest?
 int compareTo(java.lang.Object obj)
          Compares two SubProvinces by Province, Coast
 boolean equals(java.lang.Object obj)
          Compares two SubProvinces by Province, Coast
 java.lang.String getAbbreviation()
          Returns the abbreviation of the subprovince
 int getCoast()
          Returns the coast
 java.util.SortedSet getMoves()
          Returns all possible destination SubProvinces
 Province getProvince()
          Returns the province
 java.lang.String getUnitText()
          Returns a text for a unit in this sub province, e.g.
 int hashCode()
          Returns a hashcode for this SubProvince.
 boolean isCoast()
          Is this subprovince a real coast
 boolean isSea()
          True if it is sea or any coast.
 java.lang.String toString()
          Returns the name of the subprovince
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

getProvince

public Province getProvince()
Returns the province


getCoast

public int getCoast()
Returns the coast


isSea

public boolean isSea()
True if it is sea or any coast.


getMoves

public java.util.SortedSet getMoves()
Returns all possible destination SubProvinces


canMoveTo

public boolean canMoveTo(SubProvince dest)
Can a unit in this subprovince move to dest?


canSupport

public boolean canSupport(Province dest)
Can a unit support the province dest?


canConvoy

public boolean canConvoy()
Returns true if a unit in this subprovince can convoy an army


getUnitText

public java.lang.String getUnitText()
Returns a text for a unit in this sub province, e.g. "fleet in the Ionian Sea".


equals

public boolean equals(java.lang.Object obj)
Compares two SubProvinces by Province, Coast

Overrides:
equals in class java.lang.Object

compareTo

public int compareTo(java.lang.Object obj)
Compares two SubProvinces by Province, Coast

Specified by:
compareTo in interface java.lang.Comparable

hashCode

public int hashCode()
Returns a hashcode for this SubProvince.

Overrides:
hashCode in class java.lang.Object

getAbbreviation

public java.lang.String getAbbreviation()
Returns the abbreviation of the subprovince


isCoast

public boolean isCoast()
Is this subprovince a real coast


toString

public java.lang.String toString()
Returns the name of the subprovince

Overrides:
toString in class java.lang.Object