public final class TimeRanges
extends java.lang.Object
Constructor and Description |
---|
TimeRanges()
Initializes a new instance of the
TimeRanges class. |
Modifier and Type | Method and Description |
---|---|
void |
add(DateTime start,
DateTime end)
Adds a new time span to the list.
|
void |
addChangeListener(ChangeListener listener) |
void |
clear()
Clears the current time ranges.
|
boolean |
contains(DateTime date)
Determines whether the specified date is contained within
one of the date ranges.
|
boolean |
contains(DateTime date,
boolean includeEnd)
Determines whether the specified date is contained within
one of the date ranges.
|
boolean |
contains(DateTime start,
DateTime end)
Determines whether the specified range is completely
contained within one of the date ranges.
|
java.util.List<DateTime> |
getRanges()
Gets a read-only
DateTime list. |
boolean |
intersects(DateTime start,
DateTime end)
Determines whether the specified range is partially contained
within one of the date ranges.
|
boolean |
isEmpty()
Gets a value indicating whether the
TimeRanges object is empty. |
TimeRanges |
not(DateTime start,
DateTime end)
Returns the exclusion of this
TimeRanges object in
the specified interval. |
void |
remove(DateTime start,
DateTime end)
Removes a time span from the list.
|
void |
removeChangeListener(ChangeListener listener) |
public TimeRanges()
TimeRanges
class.public void add(DateTime start, DateTime end)
public void remove(DateTime start, DateTime end)
public void clear()
public TimeRanges not(DateTime start, DateTime end)
TimeRanges
object in
the specified interval.public boolean contains(DateTime date)
public boolean contains(DateTime date, boolean includeEnd)
public boolean contains(DateTime start, DateTime end)
public boolean intersects(DateTime start, DateTime end)
public java.util.List<DateTime> getRanges()
DateTime
list. Each pair of
dates in the list represents a time range.public boolean isEmpty()
TimeRanges
object is empty.public void addChangeListener(ChangeListener listener)
public void removeChangeListener(ChangeListener listener)