Package org.deltava.beans
Class DateRange
java.lang.Object
org.deltava.beans.DateRange
- All Implemented Interfaces:
Serializable
,Comparable<DateRange>
,ComboAlias
A bean to store date/time ranges.
- Since:
- 3.6
- Version:
- 11.0
- Author:
- Luke
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
Compares two date ranges by comparing their start and end date/times.boolean
Returns whether a date/time is contained within this range.static DateRange
createMonth
(ZonedDateTime zdt) Creates a date range for a specific month.static DateRange
createWeek
(ZonedDateTime zdt) Creates a date range for a specific week.static DateRange
createYear
(ZonedDateTime zdt) Creates a date range for a specific year.boolean
Returns the alias to use in the HTML <OPTION> element.Returns the visible name to use in the HTML <OPTION> element.Returns the end of the range.getLabel()
Returns the range label.long
Returns the size of the range.Returns the start of the range.int
hashCode()
static DateRange
Parses a Date range combo alias.toString()
-
Constructor Details
-
DateRange
-
-
Method Details
-
createWeek
Creates a date range for a specific week.- Parameters:
zdt
- a date/time within that day- Returns:
- a DateRange
-
createMonth
Creates a date range for a specific month.- Parameters:
zdt
- a date/time within that month- Returns:
- a DateRange
-
createYear
Creates a date range for a specific year.- Parameters:
zdt
- a date/time within that year- Returns:
- a DateRange
-
parse
-
getStartDate
-
getEndDate
-
getLabel
-
contains
Returns whether a date/time is contained within this range.- Parameters:
dt
- the date/time- Returns:
- TRUE if contained, otherwise FALSE
-
getLength
public long getLength()Returns the size of the range.- Returns:
- the size in milliseconds
-
getComboName
Description copied from interface:ComboAlias
Returns the visible name to use in the HTML <OPTION> element.- Specified by:
getComboName
in interfaceComboAlias
- Returns:
- The visible name for this entry
-
getComboAlias
Description copied from interface:ComboAlias
Returns the alias to use in the HTML <OPTION> element.- Specified by:
getComboAlias
in interfaceComboAlias
- Returns:
- The alias for this entry
-
hashCode
-
toString
-
compareTo
Compares two date ranges by comparing their start and end date/times.- Specified by:
compareTo
in interfaceComparable<DateRange>
-
equals
-