public abstract static class DoubleIterators.AbstractIndexBasedListIterator extends DoubleIterators.AbstractIndexBasedIterator implements DoubleListIterator
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).
Modifier and Type | Method and Description |
---|---|
void |
add(double k)
Inserts the specified element into the list (optional operation).
|
int |
back(int n)
Moves back for the given number of elements.
|
boolean |
hasPrevious()
Returns whether there is a previous element.
|
int |
nextIndex() |
double |
previousDouble()
Returns the previous element as a primitive type.
|
int |
previousIndex() |
void |
set(double k)
Replaces the last element returned by
DoubleListIterator.next() or
DoubleListIterator.previous() with the specified element (optional operation). |
forEachRemaining, hasNext, nextDouble, remove, skip
forEachRemaining
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
add, next, previous, remove, set
skip
forEachRemaining, forEachRemaining, nextDouble
public boolean hasPrevious()
BidirectionalIterator
hasPrevious
in interface BidirectionalIterator<java.lang.Double>
hasPrevious
in interface java.util.ListIterator<java.lang.Double>
ListIterator.hasPrevious()
public double previousDouble()
DoubleBidirectionalIterator
previousDouble
in interface DoubleBidirectionalIterator
ListIterator.previous()
public int nextIndex()
nextIndex
in interface java.util.ListIterator<java.lang.Double>
public int previousIndex()
previousIndex
in interface java.util.ListIterator<java.lang.Double>
public void add(double k)
DoubleListIterator
This default implementation just throws an UnsupportedOperationException
.
add
in interface DoubleListIterator
k
- the element to insert.ListIterator.add(Object)
public void set(double k)
DoubleListIterator
DoubleListIterator.next()
or
DoubleListIterator.previous()
with the specified element (optional operation).set
in interface DoubleListIterator
k
- the element used to replace the last element returned.
This default implementation just throws an UnsupportedOperationException
.
ListIterator.set(Object)
public int back(int n)
DoubleBidirectionalIterator
The effect of this call is exactly the same as that of
calling DoubleBidirectionalIterator.previous()
for n
times (possibly stopping
if BidirectionalIterator.hasPrevious()
becomes false).
back
in interface DoubleBidirectionalIterator
back
in interface ObjectBidirectionalIterator<java.lang.Double>
n
- the number of elements to skip back.DoubleBidirectionalIterator.previous()