|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.hagenah.diplomacy.map.Phase
public final class Phase
The Phase class represents a phase like Spring 1901 Movement.
| Field Summary | |
|---|---|
int |
MAX_YEAR
Maximum allowed year of the phase |
int |
MIN_YEAR
Minimum allowed year of the phase |
| Constructor Summary | |
|---|---|
Phase(int year,
boolean fall,
boolean retreat,
boolean adjustment)
Creates a new Phase Object. |
|
Phase(java.lang.String name)
Creates a Phase object for the string "(S|F|W|Spring|Fall|Winter)xxxx((M|R|B|A)X? |
|
| Method Summary | |
|---|---|
boolean |
canSucceed(Phase nextphase)
Can nextphase succeed to this phase? |
protected java.lang.Object |
clone()
|
int |
compareTo(java.lang.Object obj)
Compares two Phases |
boolean |
equals(java.lang.Object obj)
Compares two Phases |
Phase |
getSuccessor(boolean retreats,
boolean builds)
Determines the next phase. |
int |
getYear()
|
int |
hashCode()
Returns a hashcode for this Phase. |
boolean |
isAdjustment()
|
boolean |
isFall()
|
boolean |
isMovement()
|
boolean |
isRetreat()
|
boolean |
isSpring()
|
java.lang.String |
toShortString()
Returns a short string (sxxxxp) e.g. |
java.lang.String |
toString()
Returns a string e.g. |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public final int MIN_YEAR
public final int MAX_YEAR
| Constructor Detail |
|---|
public Phase(int year,
boolean fall,
boolean retreat,
boolean adjustment)
throws java.lang.IllegalArgumentException
year - Year (MIN_YEAR..MAX_YEAR)fall - retreat - adjustment - Only the following combinations are valid:
java.lang.IllegalArgumentException
public Phase(java.lang.String name)
throws java.lang.IllegalArgumentException
name - Phase String (!=null).
java.lang.IllegalArgumentException| Method Detail |
|---|
public int getYear()
public boolean isSpring()
public boolean isFall()
public boolean isMovement()
public boolean isRetreat()
public boolean isAdjustment()
public boolean canSucceed(Phase nextphase)
public Phase getSuccessor(boolean retreats,
boolean builds)
retreats - Are any retreats neccessary?builds - Are any builds neccessary?
protected java.lang.Object clone()
clone in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int compareTo(java.lang.Object obj)
compareTo in interface java.lang.Comparablepublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String toShortString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||