@Immutable public class CalendarPeriod extends Object
Modifier and Type | Class and Description |
---|---|
static class |
CalendarPeriod.Field |
Modifier and Type | Field and Description |
---|---|
static CalendarPeriod |
Hour |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
static CalendarPeriod.Field |
fromUnitString(String udunit)
Convert a period string into a CalendarPeriod.Field.
|
double |
getConvertFactor(CalendarPeriod from)
Get the conversion factor of the other CalendarPeriod to this one
|
CalendarPeriod.Field |
getField() |
int |
getOffset(CalendarDate start,
CalendarDate end) |
int |
getValue() |
double |
getValueInMillisecs()
Deprecated.
dont use because these are fixed length and thus approximate.
|
int |
hashCode() |
CalendarPeriod |
multiply(int value)
Multiply the period by an integer
|
static CalendarPeriod |
of(int value,
CalendarPeriod.Field field) |
static CalendarPeriod |
of(String udunit)
Convert a udunit period string into a CalendarPeriod
|
static CalendarPeriod |
of(TimeDuration td) |
int |
subtract(CalendarDate start,
CalendarDate end)
Subtract two dates, return difference in units of this period.
|
String |
toString() |
public static final CalendarPeriod Hour
public static CalendarPeriod.Field fromUnitString(String udunit)
udunit
- period stringIllegalArgumentException
- if not valid formatpublic static CalendarPeriod of(int value, CalendarPeriod.Field field)
public static CalendarPeriod of(String udunit)
udunit
- period string : "[val] unit"public static CalendarPeriod of(TimeDuration td)
public CalendarPeriod multiply(int value)
value
- multiply by thispublic int getValue()
public CalendarPeriod.Field getField()
public int subtract(CalendarDate start, CalendarDate end)
start
- start dateend
- end datepublic double getConvertFactor(CalendarPeriod from)
from
- convert from thispublic double getValueInMillisecs()
public int getOffset(CalendarDate start, CalendarDate end)