Class DoubleIterators.AbstractIndexBasedListIterator
- All Implemented Interfaces:
BidirectionalIterator<Double>,DoubleBidirectionalIterator,DoubleIterator,DoubleListIterator,ObjectBidirectionalIterator<Double>,ObjectIterator<Double>,Iterator<Double>,ListIterator<Double>,PrimitiveIterator<Double, DoubleConsumer>,PrimitiveIterator.OfDouble
- Enclosing class:
DoubleIterators
This class is only appropriate for sequences that are at most Integer.MAX_VALUE long. If
your backing data store can be bigger then this, consider the equivalently named class in the
type specific BigListSpliterators class.
As the abstract methods in this class are used in inner loops, it is generally a good idea to
override the class as final as to encourage the JVM to inline them (or alternatively,
override the abstract methods as final).
-
Nested Class Summary
Nested classes/interfaces inherited from interface java.util.PrimitiveIterator
PrimitiveIterator.OfDouble, PrimitiveIterator.OfInt, PrimitiveIterator.OfLong -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(double k) Inserts the specified element into the list (optional operation).intback(int n) Moves back for the given number of elements.booleanReturns whether there is a previous element.intdoubleReturns the previous element as a primitive type.intvoidset(double k) Replaces the last element returned byDoubleListIterator.next()orDoubleListIterator.previous()with the specified element (optional operation).Methods inherited from class it.unimi.dsi.fastutil.doubles.DoubleIterators.AbstractIndexBasedIterator
forEachRemaining, hasNext, nextDouble, remove, skipMethods inherited from class it.unimi.dsi.fastutil.doubles.AbstractDoubleIterator
forEachRemainingMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface it.unimi.dsi.fastutil.doubles.DoubleBidirectionalIterator
skipMethods inherited from interface it.unimi.dsi.fastutil.doubles.DoubleIterator
forEachRemaining, forEachRemaining, nextDoubleMethods inherited from interface it.unimi.dsi.fastutil.doubles.DoubleListIterator
add, next, previous, remove, setMethods inherited from interface java.util.ListIterator
hasNextMethods inherited from interface java.util.PrimitiveIterator.OfDouble
forEachRemaining
-
Method Details
-
hasPrevious
public boolean hasPrevious()Description copied from interface:BidirectionalIteratorReturns whether there is a previous element.- Specified by:
hasPreviousin interfaceBidirectionalIterator<Double>- Specified by:
hasPreviousin interfaceListIterator<Double>- Returns:
- whether there is a previous element.
- See Also:
-
previousDouble
public double previousDouble()Description copied from interface:DoubleBidirectionalIteratorReturns the previous element as a primitive type.- Specified by:
previousDoublein interfaceDoubleBidirectionalIterator- Returns:
- the previous element in the iteration.
- See Also:
-
nextIndex
public int nextIndex()- Specified by:
nextIndexin interfaceListIterator<Double>
-
previousIndex
public int previousIndex()- Specified by:
previousIndexin interfaceListIterator<Double>
-
add
public void add(double k) Description copied from interface:DoubleListIteratorInserts the specified element into the list (optional operation).This default implementation just throws an
UnsupportedOperationException.- Specified by:
addin interfaceDoubleListIterator- Parameters:
k- the element to insert.- See Also:
-
set
public void set(double k) Description copied from interface:DoubleListIteratorReplaces the last element returned byDoubleListIterator.next()orDoubleListIterator.previous()with the specified element (optional operation).- Specified by:
setin interfaceDoubleListIterator- Parameters:
k- the element used to replace the last element returned.This default implementation just throws an
UnsupportedOperationException.- See Also:
-
back
public int back(int n) Description copied from interface:DoubleBidirectionalIteratorMoves back for the given number of elements.The effect of this call is exactly the same as that of calling
DoubleBidirectionalIterator.previous()forntimes (possibly stopping ifBidirectionalIterator.hasPrevious()becomes false).- Specified by:
backin interfaceDoubleBidirectionalIterator- Specified by:
backin interfaceObjectBidirectionalIterator<Double>- Parameters:
n- the number of elements to skip back.- Returns:
- the number of elements actually skipped.
- See Also:
-