public class DateRange extends Object
| Constructor and Description |
|---|
DateRange(Date startDate,
Date endDate)
Create a date range from individual components, using the default label.
|
DateRange(DateRange dateRange)
Copy constructor.
|
DateRange(String data)
Create a date range item from its string representation.
|
DateRange(String label,
Date startDate,
Date endDate)
Create a date range from individual components.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object value)
Checks for equality based on start and end dates.
|
Date |
getEndDate()
Returns the end date.
|
String |
getLabel()
Returns the display label.
|
String |
getRawEndDate()
Returns the raw end date.
|
String |
getRawStartDate()
Returns the raw start date.
|
Date |
getStartDate()
Returns the start date.
|
boolean |
inRange(Date refDate)
Returns true if the reference date is within this range.
|
boolean |
inRange(Date refDate,
boolean inclusiveStart,
boolean inclusiveEnd)
Returns true if the reference date is within this range.
|
boolean |
inRange(DateRange refRange)
Returns true if the reference range is wholly contained within this range.
|
boolean |
inRange(DateRange refRange,
boolean inclusiveStart,
boolean inclusiveEnd)
Returns true if the reference range is wholly contained within this range.
|
boolean |
isDefault()
Returns the default flag.
|
protected void |
setEndDate(String endDate)
Sets the end date.
|
protected void |
setStartDate(String startDate)
Sets the start date.
|
String |
toString()
Returns the serialized version of the object.
|
public DateRange(String data)
data - Format is label|start date|end date|default Only label is required.public DateRange(String label, Date startDate, Date endDate)
label - Displayable text. If null, a default label is created.startDate - The start date.endDate - The end date.public DateRange(Date startDate, Date endDate)
startDate - The start date.endDate - The end date.public DateRange(DateRange dateRange)
dateRange - Date range to copy.public boolean equals(Object value)
public String toString()
protected void setStartDate(String startDate)
startDate - The start date.protected void setEndDate(String endDate)
endDate - The end date.public String getLabel()
public Date getStartDate()
public Date getEndDate()
public String getRawStartDate()
public String getRawEndDate()
public boolean isDefault()
public boolean inRange(Date refDate)
refDate - A reference date.public boolean inRange(Date refDate, boolean inclusiveStart, boolean inclusiveEnd)
refDate - A reference date.inclusiveStart - If true, the start date is included in the range.inclusiveEnd - If true, the end date is included in the range.public boolean inRange(DateRange refRange)
refRange - A reference date range.public boolean inRange(DateRange refRange, boolean inclusiveStart, boolean inclusiveEnd)
refRange - A reference date range.inclusiveStart - If true, the start date is included in the range.inclusiveEnd - If true, the end date is included in the range.Copyright © 2023 Fujion Framework. All rights reserved.