Package manifold.collections.api.range
Class IntegerRange
- java.lang.Object
-
- manifold.collections.api.range.AbstractRange<E,ME>
-
- manifold.collections.api.range.AbstractIterableRange<E,E,Void,ME>
-
- manifold.collections.api.range.NumberRange<Integer,IntegerRange>
-
- manifold.collections.api.range.IntegerRange
-
- All Implemented Interfaces:
Iterable<Integer>,IterableRange<Integer,Integer,Void,IntegerRange>,Range<Integer,IntegerRange>
public final class IntegerRange extends NumberRange<Integer,IntegerRange>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classIntegerRange.ForwardIterator
-
Constructor Summary
Constructors Constructor Description IntegerRange(Integer left, Integer right)IntegerRange(Integer left, Integer right, int step)IntegerRange(Integer left, Integer right, int step, boolean leftClosed, boolean rightClosed, boolean reverse)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IntegergetFromLeft(int iStepIndex)IntegergetFromRight(int iStepIndex)Iterator<Integer>iterateFromLeft()Iterator<Integer>iterateFromRight()-
Methods inherited from class manifold.collections.api.range.AbstractIterableRange
equals, getStep, getUnit, hashCode, iterator, step, toString, unit
-
Methods inherited from class manifold.collections.api.range.AbstractRange
contains, contains, getLeftEndpoint, getRightEndpoint, isLeftClosed, isReversed, isRightClosed
-
Methods inherited from class java.lang.Object
clone, emptyArray, finalize, getClass, jailbreak, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
count, count, distinctBy, distinctList, filterIndexedTo, filterIndexedToList, filterNotTo, filterNotToList, filterTo, filterToList, first, first, firstOrNull, firstOrNull, flatMap, flatMapTo, fold, forEach, forEachIndexed, indexOfFirst, indexOfLast, intersect, joinTo, joinToString, last, last, lastOrNull, lastOrNull, mapIndexed, mapIndexedNotNull, mapIndexedNotNullTo, mapIndexedNotNullToList, mapIndexedTo, mapIndexedToList, mapNotNull, mapNotNullTo, mapNotNullToList, mapTo, mapToList, maxWith, minWith, partition, reversed, single, single, singleOrNull, singleOrNull, spliterator, subList, subList, subtract, toList, toSet, union
-
Methods inherited from interface manifold.collections.api.range.Range
contains, contains, getLeftEndpoint, getRightEndpoint, isLeftClosed, isReversed, isRightClosed
-
-
-
-
Method Detail
-
iterateFromLeft
public Iterator<Integer> iterateFromLeft()
- Returns:
- An iterator that visits the elements in this range in order, from left to right. Returns null if this range does not support iteration.
- See Also:
IterableRange.iterator(),IterableRange.iterateFromRight()
-
iterateFromRight
public Iterator<Integer> iterateFromRight()
- Returns:
- An iterator that visits the elements in this range in reverse order, from right to left. Returns null if this range does not support iteration.
- See Also:
IterableRange.iterator(),IterableRange.iterateFromLeft()
-
getFromLeft
public Integer getFromLeft(int iStepIndex)
- Parameters:
iStepIndex- The index of the step from the left endpoint- Returns:
- The nth step from the left endpoint. Returns null if iStepIndex is out of bounds.
-
getFromRight
public Integer getFromRight(int iStepIndex)
- Parameters:
iStepIndex- The index of the step from the right endpoint- Returns:
- The nth step from the right endpoint. Returns null if iStepIndex is out of bounds.
-
-