Package org.apache.ofbiz.base.lang
Class ComparableRange<T extends java.lang.Comparable<T>>
- java.lang.Object
-
- org.apache.ofbiz.base.lang.ComparableRange<T>
-
- All Implemented Interfaces:
java.lang.Comparable<ComparableRange<T>>
,Range<T>
- Direct Known Subclasses:
DateRange
public class ComparableRange<T extends java.lang.Comparable<T>> extends java.lang.Object implements Range<T>, java.lang.Comparable<ComparableRange<T>>
A range of values.
-
-
Constructor Summary
Constructors Constructor Description ComparableRange(T start, T end)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
after(Range<T> range)
Returnstrue
if the lowest value in this range occurs after the greatest value inrange
.boolean
after(T value)
Returnstrue
if this range occurs aftervalue
.boolean
before(Range<T> range)
Returnstrue
if the greatest value in this range occurs before the lowest value inrange
.boolean
before(T value)
Returnstrue
if this range occurs beforevalue
.int
compareTo(ComparableRange<T> range)
T
end()
Returns the ending value of this range.boolean
equals(java.lang.Object obj)
int
hashCode()
boolean
includes(Range<T> range)
Returnstrue
if this range includesrange
.boolean
includes(T value)
Returnstrue
ifvalue
occurs within this range.boolean
isPoint()
Returnstrue
if the starting and ending values are equal.boolean
overlaps(Range<T> range)
Returnstrue
if this range overlapsrange
.T
start()
Returns the starting value of this range.java.lang.String
toString()
-
-
-
Method Detail
-
after
public boolean after(Range<T> range)
Description copied from interface:Range
Returnstrue
if the lowest value in this range occurs after the greatest value inrange
.
-
after
public boolean after(T value)
Description copied from interface:Range
Returnstrue
if this range occurs aftervalue
.
-
before
public boolean before(Range<T> range)
Description copied from interface:Range
Returnstrue
if the greatest value in this range occurs before the lowest value inrange
.
-
before
public boolean before(T value)
Description copied from interface:Range
Returnstrue
if this range occurs beforevalue
.
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
compareTo
public int compareTo(ComparableRange<T> range)
-
includes
public boolean includes(Range<T> range)
Description copied from interface:Range
Returnstrue
if this range includesrange
.
-
includes
public boolean includes(T value)
Description copied from interface:Range
Returnstrue
ifvalue
occurs within this range.
-
isPoint
public boolean isPoint()
Description copied from interface:Range
Returnstrue
if the starting and ending values are equal.
-
overlaps
public boolean overlaps(Range<T> range)
Description copied from interface:Range
Returnstrue
if this range overlapsrange
.
-
start
public T start()
Description copied from interface:Range
Returns the starting value of this range.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-