|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface PartitionSize
A class which simplifies partitioning Dates based on human logical time intervals: Day, Week, TwoYear. Implementing classes provide methods to align Calendars at the start of the nearest Day, Month, Week, etc. In addition, implementors provide methods to create new Calendars based on their specific alignment size.
| Field Summary | |
|---|---|
static long |
DAY_IN_MONTH
approximate days in one month, that is, 30 days |
static long |
DAY_IN_WEEK
days in a 7 day week... |
static long |
DAY_IN_YEAR
days in one year, assuming a non-leap year |
static String |
DAY_NAME
|
static long |
HOUR_IN_DAY
hours in a day: 24 |
static String |
HOUR_NAME
|
static String |
MONTH_NAME
|
static long |
MS_IN_DAY
milliseconds in 1 day (approximate: no leap second accounted for) |
static long |
MS_IN_HOUR
milliseconds in 1 hour (approximate: no leap second accounted for) |
static long |
MS_IN_MONTH
milliseconds in one month (approximate: no leap day/sec accounted for, and assumes 30 days in a month) |
static long |
MS_IN_SEC
number of milliseconds in a second.. |
static long |
MS_IN_TWO_MONTH
milliseconds in two months (approximate: no leap day/sec accounted for, and assumes 30 day months) |
static long |
MS_IN_TWO_YEAR
milliseconds in two years (approximate: no leap day/sec accounted for) |
static long |
MS_IN_WEEK
milliseconds in 7 days (approximate: no leap second accounted for) |
static long |
MS_IN_YEAR
milliseconds in one year (approximate: no leap day/sec accounted for) |
static long |
SEC_IN_HOUR
seconds in a non-leap-second hour |
static String |
TWO_MONTH_NAME
|
static String |
TWO_YEAR_NAME
|
static String |
WEEK_NAME
|
static String |
YEAR_NAME
|
| Method Summary | |
|---|---|
void |
alignStart(Calendar in)
Align the calendar argument to the start of the interval covered by this size. |
Calendar |
increment(Calendar start,
int offset)
Create a new Calendar object, aligned relative to the Calendar argument, either forward or backward some number of partitions. |
long |
intervalMS()
|
String |
name()
|
| Field Detail |
|---|
static final long MS_IN_SEC
static final long SEC_IN_HOUR
static final long HOUR_IN_DAY
static final long DAY_IN_WEEK
static final long DAY_IN_MONTH
static final long DAY_IN_YEAR
static final long MS_IN_HOUR
static final long MS_IN_DAY
static final long MS_IN_WEEK
static final long MS_IN_MONTH
static final long MS_IN_TWO_MONTH
static final long MS_IN_YEAR
static final long MS_IN_TWO_YEAR
static final String HOUR_NAME
static final String DAY_NAME
static final String WEEK_NAME
static final String MONTH_NAME
static final String TWO_MONTH_NAME
static final String YEAR_NAME
static final String TWO_YEAR_NAME
| Method Detail |
|---|
void alignStart(Calendar in)
in - Calendar object which has internal Date set
Calendar increment(Calendar start,
int offset)
start - the returned Calendar will be aligned one day, week, month,
etc. ahead or behind of this Calendar argument.offset - the relative distance to move the returned calendar
relative to the argument Calendar.
long intervalMS()
String name()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||