public class RelativeInterval<U extends IntervalUnit> extends Interval<U>
DateUnit.MONTH
from -3 to -1 results in an
interval that includes the past 3 whole calendar months.Constructor and Description |
---|
RelativeInterval(U intervalUnit,
int start,
int end)
Creates a new absolute interval.
|
Modifier and Type | Method and Description |
---|---|
int |
getEnd()
Returns the end of the interval, in interval units relative to the
current date/time.
|
int |
getStart()
Returns the start of the interval, in interval units relative to the
current date/time.
|
public RelativeInterval(U intervalUnit, int start, int end) throws NullIntervalException, InvalidAbsoluteIntervalException
intervalUnit
- the interval unit to usestart
- start of the interval, in interval units from the current
date/timeend
- end of the interval, in interval units from the current
date/timeNullIntervalException
- if the unit is nullInvalidAbsoluteIntervalException
- if the given start is after the
given endpublic int getStart()
public int getEnd()
Copyright © 2014. All rights reserved.