Package org.plumelib.util
Class MathPlume.MissingNumbersIteratorLong
java.lang.Object
org.plumelib.util.MathPlume.MissingNumbersIteratorLong
- 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) longThe next element to be returned by the iterator.(package private) longThe current element of the numbers not to include in the iterator.(package private) long @MonotonicNonNull @MinLen(1) []The numbers not to include in the iterator.The numbers not to include in the iterator. -
Constructor Summary
ConstructorsConstructorDescriptionMissingNumbersIteratorLong(long @MinLen(1) [] nums, boolean addEnds) An iterator over all the numbers not in its original argument array, but within its range.MissingNumbersIteratorLong(Iterator<Long> numsItor, boolean addEnds) An iterator over all the numbers not in its 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
long @MonotonicNonNull @MinLen(1) [] numsThe numbers not to include in the iterator. -
numsItor
The numbers not to include in the iterator. -
currentNonmissing
long currentNonmissingThe current element of the numbers not to include in the iterator. -
currentMissing
long 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
-
MissingNumbersIteratorLong
MissingNumbersIteratorLong(long @MinLen(1) [] nums, boolean addEnds) An iterator over all the numbers not in its original argument array, but within its range.- Parameters:
nums- a non-empty arrayaddEnds- if true, include the bracketing endpoints
-
MissingNumbersIteratorLong
An iterator over all the numbers not in its argument iterator, but within its range.- Parameters:
numsItor- a non-empty array; must return longs in sorted orderaddEnds- if true, include the bracketing endpoints
-
-
Method Details
-
hasNext
public boolean hasNext(@GuardSatisfied MathPlume.MissingNumbersIteratorLong this) -
next
-
remove
public void remove(@GuardSatisfied MathPlume.MissingNumbersIteratorLong this)
-