public class DateRange extends Range<java.util.Date> implements java.io.Serializable, java.lang.Comparable<DateRange>
Constructor and Description |
---|
DateRange() |
DateRange(java.util.Date start,
java.util.Date end) |
DateRange(Range<java.util.Date> range) |
Modifier and Type | Method and Description |
---|---|
boolean |
after(java.util.Date d)
Is our Start date after the given date
|
boolean |
after(Range<java.util.Date> date)
Is our START date after the end date of the given range
|
static DateRange |
asDateRange(Range<java.util.Date> range) |
Range<java.util.Date> |
asRange() |
boolean |
before(java.util.Date date)
is our range END before this date
|
boolean |
before(Range<java.util.Date> date)
Is our date range END before the date's START
|
int |
compareTo(DateRange o) |
void |
ensureRange(DateRange range)
Given a Range, ensure that this range can contain the new range.
|
boolean |
equals(java.lang.Object o) |
void |
expandEnd(int days)
Given the days, pad the end by that number of days
|
void |
expandEnd(int days,
DateRange other) |
void |
expandRange(int days)
Given the days, pad the start and end by that number of days
|
void |
expandRange(int days,
DateRange other)
Given the days, pad the start and end by that number of days, taking into account the difference in days
from the passed in range start end and this start end, to ensure that our padding is at least days.
|
void |
expandStart(int days)
Given the days, pad the start by that number of days
|
void |
expandStart(int days,
DateRange other) |
long |
getDurationInMillis()
Get the duration of the Date Range in milliseconds.
|
boolean |
intersects(java.util.Date clickdate)
Tests whether or not the given date intersects this range to the second.
|
boolean |
intersects(Range<java.util.Date> date)
Tests whether or not the given range intersects with this range, to the second.
|
void |
normalize()
Will normalize the dates so that start is actuall before the end.
|
void |
normalize(DateRange dates)
Will normalize, ensuring that the Start/End is not null.
|
java.lang.String |
toString() |
public DateRange(Range<java.util.Date> range)
public DateRange(java.util.Date start, java.util.Date end)
public DateRange()
public boolean intersects(java.util.Date clickdate)
clickdate
- public boolean intersects(Range<java.util.Date> date)
date
- public boolean before(java.util.Date date)
date
- public boolean before(Range<java.util.Date> date)
date
- public boolean after(java.util.Date d)
d
- public boolean after(Range<java.util.Date> date)
date
- public void normalize()
public void normalize(DateRange dates)
dates
- public void ensureRange(DateRange range)
range
- public void expandRange(int days)
days
- public void expandStart(int days)
days
- public void expandEnd(int days)
days
- public void expandRange(int days, DateRange other)
days
- public void expandStart(int days, DateRange other)
public void expandEnd(int days, DateRange other)
public long getDurationInMillis()
public Range<java.util.Date> asRange()
public int compareTo(DateRange o)
compareTo
in interface java.lang.Comparable<DateRange>