Package manifold.collections.api.range
Interface Range<E extends Comparable<E>,ME extends Range<E,ME>>
-
- Type Parameters:
E- The type of elements in the range, must implementComparableME- The range type (recursive)
- All Known Subinterfaces:
IterableRange<E,S,U,ME>
- All Known Implementing Classes:
AbstractIterableRange,AbstractRange,BigDecimalRange,BigIntegerRange,ComparableRange,DoubleRange,IntegerRange,LongRange,NumberRange,SequentialRange
public interface Range<E extends Comparable<E>,ME extends Range<E,ME>>A range ofComparableelements defined by two endpoints.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancontains(E elem)booleancontains(ME range)EgetLeftEndpoint()EgetRightEndpoint()booleanisLeftClosed()booleanisReversed()booleanisRightClosed()
-
-
-
Method Detail
-
getLeftEndpoint
E getLeftEndpoint()
- Returns:
- The left endpoint of this range where the left <= right
-
getRightEndpoint
E getRightEndpoint()
- Returns:
- The right endpoint of this range where the left <= right
-
isLeftClosed
boolean isLeftClosed()
- Returns:
- True if this range includes the left endpoint.
-
isRightClosed
boolean isRightClosed()
- Returns:
- True if this range includes the right endpoint.
-
contains
boolean contains(E elem)
- Parameters:
elem- An element to test- Returns:
- True if elem is a proper element in the set of elements defining this range.
-
contains
boolean contains(ME range)
- Parameters:
range- An range to test for containment- Returns:
- True if range's endpoints are proper elements in the set of elements defining this range.
-
isReversed
boolean isReversed()
- Returns:
- True if this range iterates from the right by default e.g., if the range is specified in reverse order: 10..1, a reverse range results
-
-