All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class java.lancs.OurDate

java.lang.Object
   |
   +----java.lancs.OurDate

public class OurDate
extends Object

Variable Index

 o APR
Constant - Month April
 o AUG
Constant - Month August
 o DEC
Constant - Month December
 o FEB
Constant - Month February
 o JAN
Constant - Month January
 o JUL
Constant - Month July
 o JUN
Constant - Month June
 o MAR
Constant - Month March
 o MAY
Constant - Month May
 o NOV
Constant - Month November
 o OCT
Constant - Month October
 o SEP
Constant - Month September

Constructor Index

 o OurDate()
Creates an instance of the OurDate class with default values (day, month and year zero)
 o OurDate(int, int, int)
Creates an instance of the OurDate class with specified attribute values

Method Index

 o copy()
return a copy of the date
 o getDayOfMonth()
returns the day within the month attribute of the date
 o getMonth()
returns the month attribute of the date
 o getYear()
returns the year attribute of the date
 o setDayOfMonth(int)
set the day within the month attribute of the date
 o setMonth(int)
set the month attribute of the date
 o setYear(int)
set the year attribute of the date
 o subtract(OurDate, OurDate)
find the number of days between two dates
 o toString()
return a string representing the date

Variables

 o JAN
 public static final int JAN
Constant - Month January

 o FEB
 public static final int FEB
Constant - Month February

 o MAR
 public static final int MAR
Constant - Month March

 o APR
 public static final int APR
Constant - Month April

 o MAY
 public static final int MAY
Constant - Month May

 o JUN
 public static final int JUN
Constant - Month June

 o JUL
 public static final int JUL
Constant - Month July

 o AUG
 public static final int AUG
Constant - Month August

 o SEP
 public static final int SEP
Constant - Month September

 o OCT
 public static final int OCT
Constant - Month October

 o NOV
 public static final int NOV
Constant - Month November

 o DEC
 public static final int DEC
Constant - Month December

Constructors

 o OurDate
 public OurDate()
Creates an instance of the OurDate class with default values (day, month and year zero)

 o OurDate
 public OurDate(int y,
                int m,
                int d)
Creates an instance of the OurDate class with specified attribute values

Parameters:
y - the year number
m - the month number (1 to 12)
d - the day number within the month (1 to 31)

Methods

 o getDayOfMonth
 public int getDayOfMonth()
returns the day within the month attribute of the date

Returns:
the day within the month attribute of the date
 o getMonth
 public int getMonth()
returns the month attribute of the date

Returns:
the month attribute of the date
 o getYear
 public int getYear()
returns the year attribute of the date

Returns:
the year attribute of the date
 o setDayOfMonth
 public void setDayOfMonth(int d)
set the day within the month attribute of the date

Parameters:
d - the day within the month attribute of the date
 o setMonth
 public void setMonth(int m)
set the month attribute of the date

Parameters:
m - the month attribute of the date
 o setYear
 public void setYear(int y)
set the year attribute of the date

Parameters:
y - the year attribute of the date
 o subtract
 public static int subtract(OurDate low,
                            OurDate high)
find the number of days between two dates

Parameters:
low - the earlier date
high - the later date
Returns:
the number of days difference
 o copy
 public OurDate copy()
return a copy of the date

Returns:
a copy of the OurDate instance
 o toString
 public String toString()
return a string representing the date

Returns:
a string representing the date "day/month/year"
Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index