All Packages Class Hierarchy This Package Previous Next Index
Class com.markcrocker.thoughtworks.MyDate
java.lang.Object
|
+----com.markcrocker.thoughtworks.MyDate
- public class MyDate
- extends Object
-
date
-
-
debugLevel
-
-
leapMonth
-
-
leapOffset
-
-
monthLength
-
-
monthOffset
-
-
MyDate(int, int, int)
- MyDate primary constructor.
-
between(MyDate)
- between.
-
getDate()
- getDate.
-
setDebugLevel(int)
- setDebugLevel.
Deprecated.
-
toString()
- toString.
monthLength
private static int monthLength[]
monthOffset
private static int monthOffset[]
leapMonth
private int leapMonth
leapOffset
private int leapOffset
debugLevel
private int debugLevel
date
private int date
MyDate
MyDate(int year,
int month,
int day) throws BadDateException
- MyDate primary constructor. Converts date to an internal format for
storage and checks for invalid or out of range dates.
- Parameters:
- year - year past 1900 (0-199). Ex: 1981 will be year 81, 2009 is 109.
- month - month of the year (1-12).
- day - day of the month (1-28,29,30, or 31) depending on the month.
- Throws: BadDateException
- thrown if the date is malformed or out of range.
getDate
public int getDate()
- getDate. Mostly used in calculating date arimthmatic.
- Returns:
- Returns date as the number of days since 1900-Jan-01.
setDebugLevel
public void setDebugLevel(int dLevel)
- Note: setDebugLevel() is deprecated.
Only used during code development.
- setDebugLevel. Sets debugLevel variable for 1960s style debugging.
toString
public String toString()
- toString. Java default string converter.
- Returns:
- Returns date as a string that represents the number of days since 1900-Jan-01.
- Overrides:
- toString in class Object
between
public int between(MyDate someOtherDate)
- between. Calculates the number of days between two dates. Commutative and exclusive.
- Returns:
- Returns number of days between two dates (exclusive).
All Packages Class Hierarchy This Package Previous Next Index