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

Variable Index

 o date
 o debugLevel
 o leapMonth
 o leapOffset
 o monthLength
 o monthOffset

Constructor Index

 o MyDate(int, int, int)
MyDate primary constructor.

Method Index

 o between(MyDate)
between.
 o getDate()
getDate.
 o setDebugLevel(int)
setDebugLevel. Deprecated.
 o toString()
toString.

Variables

 o monthLength
 private static int monthLength[]
 o monthOffset
 private static int monthOffset[]
 o leapMonth
 private int leapMonth
 o leapOffset
 private int leapOffset
 o debugLevel
 private int debugLevel
 o date
 private int date

Constructors

 o 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.

Methods

 o getDate
 public int getDate()
getDate. Mostly used in calculating date arimthmatic.

Returns:
Returns date as the number of days since 1900-Jan-01.
 o setDebugLevel
 public void setDebugLevel(int dLevel)
Note: setDebugLevel() is deprecated. Only used during code development.

setDebugLevel. Sets debugLevel variable for 1960s style debugging.

 o 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
 o 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