org.nuiton.util
Class PeriodDates
java.lang.Object
org.nuiton.util.PeriodDates
public class PeriodDates
- extends Object
TODO tchemit 2010-08-25 JAVADOC + I18N
PeriodDates.java
Created on 2009-08-13
- Version:
- $Id: PeriodDates.java 1910 2010-08-29 14:38:34Z tchemit $
- Author:
- fdesbois
PeriodDates
public PeriodDates()
PeriodDates
public PeriodDates(Date fromDate,
Date thruDate)
throws IllegalArgumentException
- Throws:
IllegalArgumentException
PeriodDates
public PeriodDates(Calendar fromCalendar,
Calendar thruCalendar)
throws IllegalArgumentException
- Throws:
IllegalArgumentException
createMonthsPeriodFromToday
public static PeriodDates createMonthsPeriodFromToday(int monthAfter)
- 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
public String getPattern()
setPattern
public void setPattern(String pattern)
initDayOfMonthExtremities
public void initDayOfMonthExtremities()
- Set first day of month for dateFrom and last day of month for dateThru
setFromDate
public void setFromDate(Date fromDate)
getFromDate
public Date getFromDate()
getFromMonth
public int getFromMonth()
setThruDate
public void setThruDate(Date thruDate)
getThruDate
public Date getThruDate()
getMonths
public List<Date> getMonths()
getFormatedMonths
public List<String> getFormatedMonths()
beforeEnd
public boolean beforeEnd(Calendar calendar)
afterEnd
public boolean afterEnd(Calendar calendar)
afterBegin
public boolean afterBegin(Calendar calendar)
between
public boolean between(Calendar calendar)
beforeEnd
public boolean beforeEnd(Date date)
afterEnd
public boolean afterEnd(Date date)
afterBegin
public boolean afterBegin(Date date)
between
public boolean between(Date date)
toString
public String toString()
- Overrides:
toString in class Object
Copyright © 2004-2010 CodeLutin. All Rights Reserved.