|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.xpn.xwiki.criteria.impl.PeriodFactory
public class PeriodFactory
Helper factory class for creating Period objects in velocity.
Field Summary | |
---|---|
static Period |
ALL_TIME
The period of time between MIN_DATE and MAX_DATE . |
Constructor Summary | |
---|---|
PeriodFactory()
|
Method Summary | |
---|---|
static Period |
createDayPeriod(long timestamp)
Creates a new Period instance that matches exactly the day that includes the specified time stamp. |
static Period |
createDayPeriod(String date)
Creates a new Period instance that matches exactly the day that includes the specified date. |
static Period |
createHourPeriod(long timestamp)
Creates a new Period instance that matches exactly the hour that includes the specified time stamp. |
static Period |
createHourPeriod(String date)
Creates a new Period instance that matches exactly the hour that includes the specified date. |
static Period |
createMaximumPeriod()
Creates a new Period instance that starts at the minimum value allowed by Date and ends at the maximum value allowed by Date. |
static Period |
createMonthPeriod(long timestamp)
Creates a new Period instance that matches exactly the month that includes the specified time stamp. |
static Period |
createMonthPeriod(String date)
Creates a new Period instance that matches exactly the month that includes the specified date. |
static Period |
createPeriod(long start,
long end)
|
static Period |
createPeriod(String start,
String end)
Creates a new custom period. |
static Period |
createSinceDaysPeriod(int numberOfDays)
Creates a new Period instance that matches all the instants between N days before the instantiation and the instantiation. |
static Period |
createSinceHoursPeriod(int numberOfHours)
Creates a new Period instance that matches all the instants between N hours before the instantiation and the instantiation. |
static Period |
createSinceMonthsPeriod(int numberOfMonths)
Creates a new Period instance that matches all the instants between N months before the instantiation and the instantiation. |
static Period |
createSinceWeeksPeriod(int numberOfWeeks)
Creates a new Period instance that matches all the instants between N weeks before the instantiation and the instantiation. |
static Period |
createSinceYearsPeriod(int numberOfYears)
Creates a new Period instance that matches all the instants between N years before the instantiation and the instantiation. |
static Period |
createWeekPeriod(long timestamp)
Creates a new Period instance that matches exactly the week that includes the specified time stamp. |
static Period |
createWeekPeriod(String date)
Creates a new Period instance that matches exactly the week that includes the specified date. |
static Period |
createYearPeriod(long timestamp)
Creates a new Period instance that matches exactly the year that includes the specified time stamp. |
static Period |
createYearPeriod(String date)
Creates a new Period instance that matches exactly the year that includes the specified date. |
static Period |
getALL_TIME()
Helper method for accessing ALL_TIME static field in velocity |
static Period |
getCurrentDay()
|
static Period |
getCurrentMonth()
|
static Period |
getCurrentWeek()
|
static Period |
getCurrentYear()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final Period ALL_TIME
MIN_DATE
and MAX_DATE
.
Constructor Detail |
---|
public PeriodFactory()
Method Detail |
---|
public static Period createPeriod(long start, long end)
Period.Period(long, long)
public static Period createPeriod(String start, String end)
start
- The start dateend
- The end date
SimpleDateFormat
public static Period createDayPeriod(long timestamp)
timestamp
- The milliseconds from 1970-01-01T00:00:00Z
public static Period createDayPeriod(String date)
date
- The string representation of a date uniquely identifying a day. Use the "yyyyMMdd" format.
SimpleDateFormat
public static Period createHourPeriod(long timestamp)
timestamp
- The milliseconds from 1970-01-01T00:00:00Z
public static Period createHourPeriod(String date)
date
- The string representation of a date uniquely identifying a day. Use the "yyyyMMdd" format.
SimpleDateFormat
public static Period createSinceHoursPeriod(int numberOfHours)
numberOfHours
- number of hours to substract from current date
public static Period createSinceDaysPeriod(int numberOfDays)
numberOfDays
- number of days to substract from current date
public static Period createSinceWeeksPeriod(int numberOfWeeks)
numberOfWeeks
- number of weeks to substract from current date
public static Period createSinceMonthsPeriod(int numberOfMonths)
numberOfMonths
- number of months to substract from current date
public static Period createSinceYearsPeriod(int numberOfYears)
numberOfYears
- number of years to substract from current date
public static Period getCurrentDay()
public static Period createWeekPeriod(long timestamp)
timestamp
- The milliseconds from 1970-01-01T00:00:00Z
public static Period createWeekPeriod(String date)
date
- The string representation of a date uniquely identifying a week. Use the "yyyyMMdd" format.
SimpleDateFormat
public static Period getCurrentWeek()
public static Period createMonthPeriod(long timestamp)
timestamp
- The milliseconds from 1970-01-01T00:00:00Z
public static Period createMonthPeriod(String date)
date
- The string representation of a date uniquely identifying a month. Use the "yyyyMMdd" format.
SimpleDateFormat
public static Period getCurrentMonth()
public static Period createYearPeriod(long timestamp)
timestamp
- The milliseconds from 1970-01-01T00:00:00Z
public static Period createYearPeriod(String date)
date
- The string representation of a date uniquely identifying a year. Use the "yyyyMMdd" format.
SimpleDateFormat
public static Period createMaximumPeriod()
public static Period getCurrentYear()
public static Period getALL_TIME()
ALL_TIME
static field in velocity
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |