public class Range<T extends Comparable<? super T>> extends Object
Range
.Modifier and Type | Method and Description |
---|---|
static <T extends Comparable<? super T>> |
closed(T from,
T to)
Factory method.
|
boolean |
contains(T value)
Returns
true if value is within the bounds of this range. |
boolean |
encloses(@NotNull Range<T> other)
Returns
true if the bounds of other do not extend outside the bounds of this
range. |
boolean |
hasLowerBound()
Returns
true if this range has a lower endpoint. |
boolean |
hasUpperBound()
Returns
true if this range has an upper endpoint. |
T |
lowerEndpoint() |
String |
toString() |
T |
upperEndpoint() |
public static <T extends Comparable<? super T>> Range<T> closed(T from, T to)
public boolean hasLowerBound()
true
if this range has a lower endpoint.public boolean hasUpperBound()
true
if this range has an upper endpoint.public boolean contains(@NotNull T value)
true
if value
is within the bounds of this range.public boolean encloses(@NotNull @NotNull Range<T> other)
true
if the bounds of other
do not extend outside the bounds of this
range.@Nullable public T lowerEndpoint()
@Nullable public T upperEndpoint()
Copyright © 2024 Global Biodiversity Information Facility (GBIF). All rights reserved.