Package org.apache.ofbiz.base.util
Class DateRange
- All Implemented Interfaces:
Serializable
,Comparable<ComparableRange<Date>>
,Range<Date>
An immutable range of dates. This class is here for backward compatibility -
new code should use
ComparableRange<Date>
instead.- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Returnstrue
if this range occurs aftervalue
.boolean
Returnstrue
if this range occurs beforevalue
.long
Returns this range's duration as a millisecond value.end()
Returns the ending value of this range.endStamp()
Returns the ending date of this range as aTimestamp
instance.boolean
includesDate
(Date date) Returnstrue
ifdate
occurs within this range.boolean
intersectsRange
(Date start, Date end) Returnstrue
ifstart
andend
intersect this range.boolean
intersectsRange
(DateRange range) Returnstrue
ifrange
intersects this range.start()
Returns the starting value of this range.Returns the starting date of this range as aTimestamp
instance.protected static Date
timestampToDate
(Date date)
-
Field Details
-
MIN_DATE
ADate
instance initialized to the earliest possible date. -
MAX_DATE
ADate
instance initialized to the latest possible date. -
FULL_RANGE
ADateRange
instance initialized to the widest possible range of dates.
-
-
Constructor Details
-
Method Details
-
timestampToDate
-
after
Description copied from interface:Range
Returnstrue
if this range occurs aftervalue
. -
before
Description copied from interface:Range
Returnstrue
if this range occurs beforevalue
. -
durationInMillis
public long durationInMillis()Returns this range's duration as a millisecond value.- Returns:
- Range duration in milliseconds
-
end
Description copied from interface:Range
Returns the ending value of this range. -
endStamp
Returns the ending date of this range as aTimestamp
instance.- Returns:
- Range ending date
Timestamp
-
includesDate
Returnstrue
ifdate
occurs within this range.- Parameters:
date
-- Returns:
true
ifdate
occurs within this range
-
intersectsRange
Returnstrue
ifstart
andend
intersect this range. -
intersectsRange
Returnstrue
ifrange
intersects this range.- Parameters:
range
-- Returns:
true
ifrange
intersects this range
-
start
Description copied from interface:Range
Returns the starting value of this range. -
startStamp
Returns the starting date of this range as aTimestamp
instance.- Returns:
- Range starting date
Timestamp
-