Package org.gbif.api.util
Class Range<T extends Comparable<? super T>>
- java.lang.Object
-
- org.gbif.api.util.Range<T>
-
public class Range<T extends Comparable<? super T>> extends Object
Simplified version of guava'sRange
.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T extends Comparable<? super T>>
Range<T>closed(T from, T to)
Factory method.boolean
contains(T value)
Returnstrue
ifvalue
is within the bounds of this range.boolean
encloses(@NotNull Range<T> other)
Returnstrue
if the bounds ofother
do not extend outside the bounds of this range.boolean
hasLowerBound()
Returnstrue
if this range has a lower endpoint.boolean
hasUpperBound()
Returnstrue
if this range has an upper endpoint.T
lowerEndpoint()
String
toString()
T
upperEndpoint()
-
-
-
Method Detail
-
closed
public static <T extends Comparable<? super T>> Range<T> closed(T from, T to)
Factory method.
-
hasLowerBound
public boolean hasLowerBound()
Returnstrue
if this range has a lower endpoint.
-
hasUpperBound
public boolean hasUpperBound()
Returnstrue
if this range has an upper endpoint.
-
contains
public boolean contains(@NotNull T value)
Returnstrue
ifvalue
is within the bounds of this range.
-
encloses
public boolean encloses(@NotNull @NotNull Range<T> other)
Returnstrue
if the bounds ofother
do not extend outside the bounds of this range.
-
lowerEndpoint
@Nullable public T lowerEndpoint()
-
upperEndpoint
@Nullable public T upperEndpoint()
-
-