public interface IlvTimeIncrementPolicy2 extends IlvTimeIncrementPolicy
IlvTimeIncrementPolicy2
defines a strategy for stepping through
discrete time increments. It is an extension of IlvTimeIncrementPolicy
that can be applied to JRE Calendar
instances as well as to
ICU Calendar
instances.
With instances of this interface often calendar computations can be
performed more efficiently than with instances of
IlvTimeIncrementPolicy
alone.
Modifier and Type | Interface and Description |
---|---|
static class |
IlvTimeIncrementPolicy2.Day
IlvTimeIncrementPolicy.Day implements a strategy for stepping through
discrete day increments. |
static class |
IlvTimeIncrementPolicy2.HalfDay
IlvTimeIncrementPolicy.HalfDay implements a strategy for stepping through
discrete half-day increments. |
static class |
IlvTimeIncrementPolicy2.Hour
IlvTimeIncrementPolicy.Hour implements a strategy for stepping through
discrete hour increments. |
static class |
IlvTimeIncrementPolicy2.Minute
IlvTimeIncrementPolicy.Minute implements a strategy for stepping through
discrete minute increments. |
static class |
IlvTimeIncrementPolicy2.Month
IlvTimeIncrementPolicy.Month implements a strategy for stepping through
discrete month increments. |
static class |
IlvTimeIncrementPolicy2.Second
IlvTimeIncrementPolicy.Second implements a strategy for stepping through
discrete second increments. |
static class |
IlvTimeIncrementPolicy2.Week
IlvTimeIncrementPolicy.Week implements a strategy for stepping through
discrete week increments. |
static class |
IlvTimeIncrementPolicy2.Year
IlvTimeIncrementPolicy.Year implements a strategy for stepping through
discrete year increments. |
Modifier and Type | Method and Description |
---|---|
void |
decrementTime(Calendar calendar)
Decrements the given
Calendar downwards to the previous time increment
boundary. |
void |
floorTime(Calendar calendar)
Truncates the given
Calendar downwards to the nearest time increment
boundary. |
void |
incrementTime(Calendar calendar)
Increments the given
Calendar upwards to the next time increment
boundary. |
decrementTime, floorTime, incrementTime
void floorTime(Calendar calendar)
Calendar
downwards to the nearest time increment
boundary. For example, in a minute-unit time increment policy, the floor time of
January 14th, 2001, 8:12:34 is January 14th, 2001, 8:12:00 and the floor time of
January 14th, 2001, 9:01:00 is January 14th, 2001, 9:01:00.calendar
- The calendar to floor.void incrementTime(Calendar calendar)
Calendar
upwards to the next time increment
boundary. It is assumed that the given Calendar
is already on a time
increment boundary, such as the result of calling floorTime(com.ibm.icu.util.Calendar)
. If not,
the results of this method are undefined.calendar
- The calendar to increment, which must be on a time increment
boundary.void decrementTime(Calendar calendar)
Calendar
downwards to the previous time increment
boundary. It is assumed that the given Calendar
is already on a time
increment boundary, such as the result of calling floorTime(com.ibm.icu.util.Calendar)
. If not,
the results of this method are undefined.calendar
- The calendar to decrement, which must be on a time increment
boundary.© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.