|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ofbiz.base.util.DateRange
public class DateRange
An immutable range of dates.
Field Summary | |
---|---|
protected java.util.Date |
end
|
static DateRange |
FullRange
A DateRange instance initialized to the widest possible range of dates. |
static java.util.Date |
MAX_DATE
A Date instance initialized to the latest possible date. |
static java.util.Date |
MIN_DATE
A Date instance initialized to the earliest possible date. |
protected java.util.Date |
start
|
Constructor Summary | |
---|---|
protected |
DateRange()
|
|
DateRange(java.util.Date start,
java.util.Date end)
|
Method Summary | |
---|---|
boolean |
after(java.util.Date date)
Returns true if this range occurs after date . |
boolean |
after(DateRange range)
Returns true if the earliest date in this range
occurs after the latest date in range . |
boolean |
before(java.util.Date date)
Returns true if this range occurs before date . |
boolean |
before(DateRange range)
Returns true if the latest date in this range
occurs before the earliest date in range . |
protected java.util.Date |
downcastTimestamp(java.util.Date date)
|
long |
durationInMillis()
Returns this range's duration as a millisecond value. |
java.util.Date |
end()
Returns the ending date of this range. |
java.sql.Timestamp |
endStamp()
Returns the ending date of this range as a Timestamp instance. |
boolean |
equals(java.lang.Object obj)
|
boolean |
includesDate(java.util.Date date)
Returns true if date occurs within this range. |
boolean |
intersectsRange(java.util.Date start,
java.util.Date end)
Returns true if start and end
intersect this range. |
boolean |
intersectsRange(DateRange range)
Returns true if range intersects this range. |
boolean |
isAscending()
Returns true if the ending date is later than the starting date. |
boolean |
isPoint()
Returns true if the starting and ending dates are equal. |
java.util.Date |
start()
Returns the starting date of this range. |
java.sql.Timestamp |
startStamp()
Returns the starting date of this range as a Timestamp instance. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.util.Date MIN_DATE
Date
instance initialized to the earliest possible date.
public static final java.util.Date MAX_DATE
Date
instance initialized to the latest possible date.
public static final DateRange FullRange
DateRange
instance initialized to the widest possible range of dates.
protected java.util.Date start
protected java.util.Date end
Constructor Detail |
---|
protected DateRange()
public DateRange(java.util.Date start, java.util.Date end)
start
- If null, defaults to MIN_DATEend
- If null, defaults to MAX_DATEMethod Detail |
---|
public long durationInMillis()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public java.util.Date start()
public java.sql.Timestamp startStamp()
Timestamp
instance.
Timestamp
public java.util.Date end()
public java.sql.Timestamp endStamp()
Timestamp
instance.
Timestamp
public boolean isAscending()
true
if the ending date is later than the starting date.
true
if the ending date is later than the starting datepublic boolean isPoint()
true
if the starting and ending dates are equal.
true
if the starting and ending dates are equalpublic boolean includesDate(java.util.Date date)
true
if date
occurs within this range.
date
-
true
if date
occurs within this rangepublic boolean before(java.util.Date date)
true
if this range occurs before date
.
date
-
true
if this range occurs before date
public boolean before(DateRange range)
true
if the latest date in this range
occurs before the earliest date in range
.
range
-
true
if the latest date in this range
occurs before the earliest date in range
public boolean after(java.util.Date date)
true
if this range occurs after date
.
date
-
true
if this range occurs after date
public boolean after(DateRange range)
true
if the earliest date in this range
occurs after the latest date in range
.
range
-
true
if the earliest date in this range
occurs after the latest date in range
public boolean intersectsRange(DateRange range)
true
if range
intersects this range.
range
-
true
if range
intersects this rangepublic boolean intersectsRange(java.util.Date start, java.util.Date end)
true
if start
and end
intersect this range.
start
- If null, defaults to MIN_DATEend
- If null, defaults to MAX_DATE
true
if start
and end
intersect this rangeprotected java.util.Date downcastTimestamp(java.util.Date date)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |