Create an interface Range<T> extends Sequence<T>, which guarantees monotonicity of its items. Change IndexRange to IntRange and implement Range<Integer>.
Problems:
Range<T> has no additional behaviour over Sequence<T>;
adds unnecessary complications to IndexRange with no benefit, other than generalisation;
Create an interface
Range<T> extends Sequence<T>
, which guarantees monotonicity of its items. ChangeIndexRange
toIntRange
and implementRange<Integer>
.Problems:
Range<T>
has no additional behaviour overSequence<T>
;IndexRange
with no benefit, other than generalisation;IntRange.get(Range<Integer>) -> Range<Integer>
Range<Integer>
is monotonically increasing or decreasing;