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.booleancontains(T value)Returnstrueifvalueis within the bounds of this range.booleanencloses(@NotNull Range<T> other)Returnstrueif the bounds ofotherdo not extend outside the bounds of this range.booleanhasLowerBound()Returnstrueif this range has a lower endpoint.booleanhasUpperBound()Returnstrueif this range has an upper endpoint.TlowerEndpoint()StringtoString()TupperEndpoint()
-
-
-
Method Detail
-
closed
public static <T extends Comparable<? super T>> Range<T> closed(T from, T to)
Factory method.
-
hasLowerBound
public boolean hasLowerBound()
Returnstrueif this range has a lower endpoint.
-
hasUpperBound
public boolean hasUpperBound()
Returnstrueif this range has an upper endpoint.
-
contains
public boolean contains(@NotNull T value)
Returnstrueifvalueis within the bounds of this range.
-
encloses
public boolean encloses(@NotNull @NotNull Range<T> other)
Returnstrueif the bounds ofotherdo not extend outside the bounds of this range.
-
lowerEndpoint
@Nullable public T lowerEndpoint()
-
upperEndpoint
@Nullable public T upperEndpoint()
-
-