Class CalendarUnit
java.lang.Object
com.webmethods.caf.faces.data.calendar.CalendarUnit
Holder class to present calendar unit information.
Represents a unit of date measurement. The types are defined by the provider.
The DefaultCalendarProvider uses day, week, month, year.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructorCalendarUnit
(Date startDate, Date endDate, int unitIndex, String units) Constructor to initialize the calendar unit's values. -
Method Summary
Modifier and TypeMethodDescriptionGet the end date of this unit.Get the start date of this unit.int
Get the current day within this unit of measure.getUnits()
Get the unit of measure.void
setEndDate
(Date endDate) Set the end date of this unit.void
setStartDate
(Date startDate) Set the start date of this unit.void
setUnitIndex
(int unitIndex) Set the index of the current day within this unit of measure.void
Set the unit of measure.
-
Field Details
-
startDate
-
endDate
-
unitIndex
protected int unitIndex -
units
-
-
Constructor Details
-
CalendarUnit
public CalendarUnit()Default constructor -
CalendarUnit
Constructor to initialize the calendar unit's values.- Parameters:
startDate
- The start date for this unit. May not be null.endDate
- The end date for this unit. May not be null.unitIndex
- The index of a Day within this unit.units
- The type of unit. ( day, week, month, year )
-
-
Method Details
-
getEndDate
Get the end date of this unit.- Returns:
- The end date this unit
-
setEndDate
Set the end date of this unit. May not be null. End date should differ from the start date by an amount based on the unit type.- Parameters:
endDate
- The end date this unit.
-
getStartDate
Get the start date of this unit.- Returns:
- The end date this unit.
-
setStartDate
Set the start date of this unit. May not be null.- Parameters:
startDate
- The start date this unit.
-
getUnitIndex
public int getUnitIndex()Get the current day within this unit of measure. Example, an index of two for a calendar unit of a week, would be Monday the second day of the week. This assumes a week that starts on Sunday.- Returns:
- The index of the day, starting at one.
-
setUnitIndex
public void setUnitIndex(int unitIndex) Set the index of the current day within this unit of measure.- Parameters:
unitIndex
- An index value that starts at one.
-
getUnits
Get the unit of measure. (day, week, month, year)- Returns:
- The text type for this calendar unit.
- See Also:
-
setUnits
Set the unit of measure. (day, week, month, year) DefaultCalendarProvider defines the unit types day, week, month, and year.- Parameters:
units
- A text value for the calendar unit type.- See Also:
-