|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdip.world.Phase.YearType
YearType is used to represent the Year
A YearType is used because we now support negative years ("BC") and need to appropriately advance, parse, and format these years.
A YearType is an immutable object.
Field Summary | |
protected int |
year
|
Constructor Summary | |
Phase.YearType(int value)
Create a new YearType |
Method Summary | |
int |
compareTo(java.lang.Object obj)
Temporally compares YearType objects |
boolean |
equals(java.lang.Object obj)
Returns true if YearTYpe objects are equivalent |
Phase.YearType |
getNext()
Get the next YearType, in sequence |
Phase.YearType |
getPrevious()
Get the previous YearType, in sequence. |
int |
getYear()
Gets the year. |
int |
hashCode()
Returns the hashcode |
static Phase.YearType |
parse(java.lang.String input)
Returns the appropriate YearType constant representing the input, or null. |
java.lang.String |
toString()
Get the name of a year. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
protected final int year
Constructor Detail |
public Phase.YearType(int value)
Method Detail |
public java.lang.String toString()
public int getYear()
public int hashCode()
public boolean equals(java.lang.Object obj)
true
if YearTYpe objects are equivalent
public int compareTo(java.lang.Object obj)
compareTo
in interface java.lang.Comparable
public Phase.YearType getNext()
public Phase.YearType getPrevious()
public static Phase.YearType parse(java.lang.String input)
0 is not a valid year
Negative years are interpreted as BC
The modifier "BC" following a year is valid
A negative year with the BC modifier is still a BC year
Periods are NOT allowed in "BC"
The modifier BC must be in lower case
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |