Package com.xpn.xwiki.criteria.impl
Class Duration
 java.lang.Object

 com.xpn.xwiki.criteria.impl.Duration

public class Duration extends Object
Immutable duration for retrieving statistics. A duration of time is uniquely identified by its span. For instance, a duration of 3 minutes doesn't imply a specific start time. It can start at any time, but it takes just 3 minutes. A Duration can be used to sample a Period of time. For instance the period between November 1th 2007 and December 1th 2007 can be divided in samples each having a duration of 3 days.


Constructor Summary
Constructors Constructor Description Duration(int years, int months, int weeks, int days)
Creates a duration by specifying a value for each of its fields.Duration(int years, int months, int weeks, int days, int hours)
Creates a duration by specifying a value for each of its fields.

Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getDays()
int
getHours()
int
getMonths()
int
getWeeks()
int
getYears()



Constructor Detail

Duration
public Duration(int years, int months, int weeks, int days)
Creates a duration by specifying a value for each of its fields. Parameters:
years
 The number of yearsmonths
 The number of monthsweeks
 The number of weeksdays
 The number of days

Duration
public Duration(int years, int months, int weeks, int days, int hours)
Creates a duration by specifying a value for each of its fields. Parameters:
years
 The number of yearsmonths
 The number of monthsweeks
 The number of weeksdays
 The number of days


Method Detail

getYears
public int getYears()
 Returns:
 The number of years this duration has

getMonths
public int getMonths()
 Returns:
 The number of months this duration has

getWeeks
public int getWeeks()
 Returns:
 The number of weeks this duration has

getDays
public int getDays()
 Returns:
 The number of days this duration has

getHours
public int getHours()
 Returns:
 The number of hours this duration has

