de.hattrickorganizer.tools
Class HTCalendar

java.lang.Object
  extended by de.hattrickorganizer.tools.HTCalendar
All Implemented Interfaces:
IHTCalendar

public class HTCalendar
extends java.lang.Object
implements IHTCalendar

HTCalendar is a class for calculating the Hattrick season and week number for a given date. Dates before October 15, 2000 can not be calculated using this calendar and will return both 0 for season and week.
Note:
October 15, 2000 was the start of Swedish season 11 and the first season for the first non-Swedish leagues that were created, namely:

Author:
Boy van der Werf

Constructor Summary
HTCalendar()
           
 
Method Summary
 int getHTSeason()
          Gets the calculated Hattrick season or 0 if the date is before the league's first season.
 int getHTWeek()
          Gets the calculated Hattrick week.
 java.util.Date getTime()
          Gets the date for which the Hattrick season and week is calculated.
 void initialize(java.util.Calendar marker)
          Initializes the HTCalendar for flip-over point.
 void setSeasonCorrection(int correction)
          Sets the season correction factor for the local league.
 void setTime(java.util.Calendar cal)
          Sets the date for which to calculate the Hattrick season and week.
 void setTime(java.util.Date time)
          Sets the date for which to calculate the Hattrick season and week.
 void setTime(java.sql.Timestamp time)
          Sets the date for which to calculate the Hattrick season and week.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HTCalendar

public HTCalendar()
Method Detail

getHTSeason

public final int getHTSeason()
Gets the calculated Hattrick season or 0 if the date is before the league's first season.

Specified by:
getHTSeason in interface IHTCalendar
Returns:
The calculated Hattrick season.

getHTWeek

public final int getHTWeek()
Gets the calculated Hattrick week. or 0 if the date is before the league's first season.

Specified by:
getHTWeek in interface IHTCalendar
Returns:
The calculated Hattrick week.

setTime

public final void setTime(java.sql.Timestamp time)
Sets the date for which to calculate the Hattrick season and week.

Specified by:
setTime in interface IHTCalendar
Parameters:
time - Date for which to calculate the Hattrick season and week.

setTime

public final void setTime(java.util.Date time)
Sets the date for which to calculate the Hattrick season and week.

Specified by:
setTime in interface IHTCalendar
Parameters:
time - Date for which to calculate the Hattrick season and week.

setTime

public final void setTime(java.util.Calendar cal)
Sets the date for which to calculate the Hattrick season and week.

Specified by:
setTime in interface IHTCalendar
Parameters:
cal - Date for which to calculate the Hattrick season and week.

getTime

public final java.util.Date getTime()
Gets the date for which the Hattrick season and week is calculated.

Specified by:
getTime in interface IHTCalendar
Returns:
Date for which the Hattrick season and week is calculated.

initialize

public void initialize(java.util.Calendar marker)
Initializes the HTCalendar for flip-over point.

Specified by:
initialize in interface IHTCalendar
Parameters:
marker - Calendar representing a day on which the week ends/starts

setSeasonCorrection

public void setSeasonCorrection(int correction)
Sets the season correction factor for the local league.

Specified by:
setSeasonCorrection in interface IHTCalendar
Parameters:
correction - TODO Missing Constructuor Parameter Documentation