public class TimeRange extends AbstractRange<java.util.Date>
| Modifier and Type | Field | Description |
|---|---|---|
protected java.util.Date |
_max |
|
protected java.util.Date |
_min |
PROPERTY_MAX, PROPERTY_MIN| Constructor | Description |
|---|---|
TimeRange() |
Sets a default time range of the whole of today
|
TimeRange(long from,
long to) |
|
TimeRange(TimeRange timeRange) |
Constructs a copy of the supplied time range
|
TimeRange(java.util.Calendar from,
java.util.Calendar to) |
|
TimeRange(java.util.Date from,
java.util.Date to) |
| Modifier and Type | Method | Description |
|---|---|---|
void |
adjust(java.util.Date lower,
java.util.Date upper) |
Adjusts the range.
|
boolean |
contains(java.util.Date x) |
Determines whether the supplied point lies within this range.
|
Range<java.util.Date> |
copy() |
|
Range<java.util.Date> |
createIntermediate(Range<java.util.Date> target,
double position) |
|
boolean |
equals(java.lang.Object other) |
|
java.util.TimeZone |
getTimeZone() |
|
int |
hashCode() |
|
java.util.Date |
lower() |
|
double |
maximum() |
This may be the numeric representation of upper() or it may be rounded up.
|
double |
minimum() |
This may be the numeric representation of lower() or it may be rounded down.
|
void |
setMax(long to) |
|
void |
setMax(java.util.Date to) |
|
void |
setMin(long from) |
|
void |
setMin(java.util.Date from) |
|
void |
setTimeZone(java.util.TimeZone timeZone) |
|
double |
size() |
Compute the size of the range
|
java.lang.String |
toString() |
|
static TimeRange |
union(TimeRange r1,
TimeRange r2) |
Creates a new TimeRange as the union of two existing TimeRanges.
|
java.util.Date |
upper() |
addPropertyChangeListener, compareTo, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListenerpublic TimeRange()
public TimeRange(java.util.Calendar from,
java.util.Calendar to)
public TimeRange(java.util.Date from,
java.util.Date to)
public TimeRange(long from,
long to)
public TimeRange(TimeRange timeRange)
timeRange - the timeRange to copypublic Range<java.util.Date> copy()
copy in class AbstractRange<java.util.Date>public void setMin(java.util.Date from)
public void setMin(long from)
public void adjust(java.util.Date lower,
java.util.Date upper)
Rangelower - the new smallest value of the rangeupper - the new largest value of the rangepublic void setMax(java.util.Date to)
public void setMax(long to)
public double minimum()
Rangepublic double maximum()
Rangepublic double size()
Rangepublic java.util.Date lower()
public java.util.Date upper()
public boolean contains(java.util.Date x)
Rangecontains() method is more like a set membership test.public java.util.TimeZone getTimeZone()
public void setTimeZone(java.util.TimeZone timeZone)
public Range<java.util.Date> createIntermediate(Range<java.util.Date> target, double position)
createIntermediate in class AbstractRange<java.util.Date>public static TimeRange union(TimeRange r1, TimeRange r2)
r1 - the first TimeRanger2 - the second TimeRangepublic boolean equals(java.lang.Object other)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object