dip.world
Class Phase.YearType

java.lang.Object
  extended bydip.world.Phase.YearType
All Implemented Interfaces:
java.lang.Comparable, java.io.Serializable
Enclosing class:
Phase

public static class Phase.YearType
extends java.lang.Object
implements java.io.Serializable, java.lang.Comparable

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.

See Also:
Serialized Form

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

year

protected final int year
Constructor Detail

Phase.YearType

public Phase.YearType(int value)
Create a new YearType

Method Detail

toString

public java.lang.String toString()
Get the name of a year.


getYear

public int getYear()
Gets the year. This will return a negative number if it is a BC year.


hashCode

public int hashCode()
Returns the hashcode


equals

public boolean equals(java.lang.Object obj)
Returns true if YearTYpe objects are equivalent


compareTo

public int compareTo(java.lang.Object obj)
Temporally compares YearType objects

Specified by:
compareTo in interface java.lang.Comparable

getNext

public Phase.YearType getNext()
Get the next YearType, in sequence


getPrevious

public Phase.YearType getPrevious()
Get the previous YearType, in sequence.


parse

public static Phase.YearType parse(java.lang.String input)
Returns the appropriate YearType constant representing the input, or null.

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



Copyright 2002-2004 Zachary DelProposto / jDip Development Team. All Rights Reserved.