Package org.plumelib.util
Class MathPlume.MissingNumbersIteratorInt
java.lang.Object
org.plumelib.util.MathPlume.MissingNumbersIteratorInt
- Enclosing class:
- MathPlume
This iterator returns all the numbers *not* in its argument array (which must be non-empty) but
in the argument's range; that is, bigger than its argument's minimum value and smaller than its
argument's maximum value. The result contains no duplicates and is in order. If boolean addEnds
is set, then the bracketing endpoints are also returned; otherwise, all returned values are
between the minimum and maximum of the original values.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) booleanIf true, include the value just before the minimum excluded element and the value just after the maximum excluded element.(package private) @org.checkerframework.checker.index.qual.IndexFor({"nums"}) intUsed only if nums != null, in which case it is an index into nums.(package private) intThe next element to be returned by the iterator.(package private) intThe current element of the numbers not to include in the iterator.(package private) int @MonotonicNonNull @MinLen(1) []The numbers not to include in the iterator.The numbers not to include in the iterator. -
Constructor Summary
ConstructorsConstructorDescriptionMissingNumbersIteratorInt(int @MinLen(1) [] nums, boolean addEnds) An iterator over all the numbers not in the argument array, but within its range.MissingNumbersIteratorInt(Iterator<Integer> numsItor, boolean addEnds) An iterator over all the numbers not in the argument iterator, but within its range. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemaining
-
Field Details
-
nums
int @MonotonicNonNull @MinLen(1) [] numsThe numbers not to include in the iterator. -
numsItor
The numbers not to include in the iterator. -
currentNonmissing
int currentNonmissingThe current element of the numbers not to include in the iterator. -
currentMissing
int currentMissingThe next element to be returned by the iterator. -
currentIndex
@org.checkerframework.checker.index.qual.IndexFor({"nums"}) int currentIndexUsed only if nums != null, in which case it is an index into nums. -
addEnds
boolean addEndsIf true, include the value just before the minimum excluded element and the value just after the maximum excluded element.
-
-
Constructor Details
-
MissingNumbersIteratorInt
MissingNumbersIteratorInt(int @MinLen(1) [] nums, boolean addEnds) An iterator over all the numbers not in the argument array, but within its range.- Parameters:
nums- a non-empty arrayaddEnds- if true, include the bracketing endpoints
-
MissingNumbersIteratorInt
An iterator over all the numbers not in the argument iterator, but within its range.- Parameters:
numsItor- a non-empty iterator; it must return integers in sorted orderaddEnds- if true, include the bracketing endpoints
-
-
Method Details
-
hasNext
public boolean hasNext(@GuardSatisfied MathPlume.MissingNumbersIteratorInt this) -
next
-
remove
public void remove(@GuardSatisfied MathPlume.MissingNumbersIteratorInt this)
-