com.facetmap.simple
Class CalendarUnit
java.lang.Object
com.facetmap.simple.CalendarUnit
public class CalendarUnit
- extends java.lang.Object
Provides a quick zoom-in/zoom-out utility for dates. Zoom levels are day,
month, year, and all-time. This utility converts all dates to UTC, and
discards any information about the time of day, so is only suitable for
dates with day precision.
|
Constructor Summary |
CalendarUnit(java.util.Date start,
java.util.Date end)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MULTI_YEAR
public static final int MULTI_YEAR
- See Also:
- Constant Field Values
YEAR
public static final int YEAR
- See Also:
- Constant Field Values
MULTI_MONTH
public static final int MULTI_MONTH
- See Also:
- Constant Field Values
MONTH
public static final int MONTH
- See Also:
- Constant Field Values
MULTI_DAY
public static final int MULTI_DAY
- See Also:
- Constant Field Values
DAY
public static final int DAY
- See Also:
- Constant Field Values
SUB_DAY
public static final int SUB_DAY
- See Also:
- Constant Field Values
INSTANT
public static final int INSTANT
- See Also:
- Constant Field Values
YEAR_PERIOD
public static final Period YEAR_PERIOD
MONTH_PERIOD
public static final Period MONTH_PERIOD
DAY_PERIOD
public static final Period DAY_PERIOD
interval
protected ReadableInterval interval
intervalScope
protected int intervalScope
CalendarUnit
public CalendarUnit(java.util.Date start,
java.util.Date end)
createIntervalScope
public int createIntervalScope(ReadableInterval interval)
getYear
public static CalendarUnit getYear(int year)
getMonth
public static CalendarUnit getMonth(int year,
int month)
- Parameters:
month - - 1=January, 12=December
getDay
public static CalendarUnit getDay(int year,
int month,
int dayOfMonth)
- Parameters:
month - - 1=January, 12=Decemberday - - 1 is the first day of the month
getBackwardUnit
public CalendarUnit getBackwardUnit(CalendarUnit maximum)
getForwardUnits
public java.util.List getForwardUnits()
matches
public boolean matches(CalendarUnit resourceCalendarUnit)
- Matches if this date interval contains the resource's date
interval, and the two intervals have similar scope (day, month, year,
or multi-year).
contains
public boolean contains(CalendarUnit calendarUnit)
getEndInstant
public java.util.Date getEndInstant()
getStartInstant
public java.util.Date getStartInstant()
getIntervalScope
public int getIntervalScope()
setIntervalScope
public void setIntervalScope(int intervalScope)