Class PeriodDates
java.lang.Object
org.nuiton.util.PeriodDates
- All Implemented Interfaces:
Serializable
TODO tchemit 2010-08-25 JAVADOC + I18N
PeriodDates.java
Created on 2009-08-13
- Author:
- fdesbois
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionPeriodDates(Calendar fromCalendar, Calendar thruCalendar) PeriodDates(Date fromDate, Date thruDate) -
Method Summary
Modifier and TypeMethodDescriptionbooleanafterBegin(Calendar calendar) booleanafterBegin(Date date) booleanbooleanbooleanbooleanbooleanbooleanstatic PeriodDatescreateMonthsPeriodFromToday(int monthAfter) Create a period from the date of today.intvoidSet first day of month for dateFrom and last day of month for dateThruvoidsetFromDate(Date fromDate) voidsetPattern(String pattern) voidsetThruDate(Date thruDate) toString()
-
Constructor Details
-
PeriodDates
public PeriodDates() -
PeriodDates
- Throws:
IllegalArgumentException
-
PeriodDates
- Throws:
IllegalArgumentException
-
-
Method Details
-
createMonthsPeriodFromToday
Create a period from the date of today. If monthAfter is negative, the current day will be the thruDate of the period. The period extremities will be initialized (first day of month for fromDate and last day of month for thruDate). Time is set to 0 for both dates.Ex 1 : Today = 12/05/2009 monthAfter = 5 Period = 01/05/2009 to 31/10/2009 Ex 2 : Today = 12/05/2009 monthAfter = -4 Period = 01/01/2009 to 31/05/2009
- Parameters:
monthAfter- the number of month from the current one- Returns:
- a new PeriodDates
-
getPattern
-
setPattern
-
initDayOfMonthExtremities
public void initDayOfMonthExtremities()Set first day of month for dateFrom and last day of month for dateThru -
setFromDate
-
getFromDate
-
getFromMonth
public int getFromMonth() -
setThruDate
-
getThruDate
-
getMonths
-
getFormatedMonths
-
beforeEnd
-
afterEnd
-
afterBegin
-
between
-
beforeEnd
-
afterEnd
-
afterBegin
-
between
-
toString
-