All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class JBMSTours.JCalendar

java.lang.Object
   |
   +----JBMSTours.JCalendar

public class JCalendar
extends Object
Look at the Source.

This class creates an array of 64 dates beginning with TODAY. Used by BuildATour to come up with dates in the next 64 days and so build a database with current data.

The static methods of this class make it easier to work with java.sql.Dates. For example, some of the methods allow you to add and subtract dates and times, since that's not built into the Java core classes.


Variable Index

 o NUMDAYS

Constructor Index

 o JCalendar()

Method Index

 o getDate(Date)
Returns the day of the month for the given date.
 o getDateDifference(Date, Date)
Get the difference between two java.sql.Dates using their UTC values.
 o getDay(int)
Get a particular day.
 o getMonth(Date)
Returns the month
 o getTheTimeDifference(Time, Time)
Returns the difference between two times as a Time.
 o getTimeDifference(Time, Time)
Returns the difference between two times as a double.
 o getToday()
Returns java.sql.Date representing the current date or a testing date (if one has been set).
 o getYear(Date)
Returns the actual year for the given date (NOT year-1900).
 o incrementDate(Date)
Increment the given date by one day.

Variables

 o NUMDAYS
 public static int NUMDAYS

Constructors

 o JCalendar
 public JCalendar()

Methods

 o getDay
 public Date getDay(int i)
Get a particular day.

Parameters:
i - the date
Returns:
the day
 o incrementDate
 public static Date incrementDate(Date theDate)
Increment the given date by one day.

Parameters:
theDate - the date to increment
Returns:
the new date (theDate + 1 day)
 o getDateDifference
 public static int getDateDifference(Date later,
                                     Date earlier)
Get the difference between two java.sql.Dates using their UTC values. If the second date is later than the first date, returns a negative number.

Parameters:
later - the first date
earlier - the second date
Returns:
int
 o getTheTimeDifference
 public static Time getTheTimeDifference(Time start,
                                         Time end)
Returns the difference between two times as a Time. If end is before beginning, assumes only one rotation of clock.

Parameters:
start - the start time
end - the end time
Returns:
the difference as a java.sql.Time
 o getTimeDifference
 public static double getTimeDifference(Time start,
                                        Time end)
Returns the difference between two times as a double. If end is before beginning, assumes only one rotation of clock.

Parameters:
start - the start time
end - the end time
Returns:
the difference as a double
 o getToday
 public static Date getToday()
Returns java.sql.Date representing the current date or a testing date (if one has been set).

Returns:
today If there is a system property called JBMSTours.testDate, we are in test mode, and that property is a String that represents the value of "now". This allows us to get consistent results while testing this application. If this property is not set, the results depend on today's date. The value of the property is specified as the number of milliseconds since January 1, 1970, 00:00:00 GMT.
 o getDate
 public static int getDate(Date d)
Returns the day of the month for the given date.

Parameters:
d - The given date.
Returns:
today
 o getYear
 public static int getYear(Date d)
Returns the actual year for the given date (NOT year-1900).

Parameters:
d - The given date.
Returns:
today
 o getMonth
 public static int getMonth(Date d)
Returns the month

Parameters:
d - The given date.
Returns:
today

All Packages  Class Hierarchy  This Package  Previous  Next  Index