it.unimi.dsi.fastutil.doubles
Class AbstractDoubleBidirectionalIterator
java.lang.Object
it.unimi.dsi.fastutil.doubles.AbstractDoubleIterator
it.unimi.dsi.fastutil.doubles.AbstractDoubleBidirectionalIterator
- All Implemented Interfaces:
- BidirectionalIterator<Double>, DoubleBidirectionalIterator, DoubleIterator, ObjectBidirectionalIterator<Double>, ObjectIterator<Double>, Iterator<Double>
- Direct Known Subclasses:
- AbstractDoubleListIterator, DoubleIterators.UnmodifiableBidirectionalIterator
public abstract class AbstractDoubleBidirectionalIterator
- extends AbstractDoubleIterator
- implements DoubleBidirectionalIterator
An abstract class facilitating the creation of type-specific bidirectional iterators.
To create a type-specific bidirectional iterator, besides what is needed
for an iterator you need both a method returning the previous element as
primitive type and a method returning the previous element as an
object. However, if you inherit from this class you need just one (anyone).
This class implements also a trivial version of back(int)
that
uses type-specific methods.
previousDouble
public double previousDouble()
- Delegates to the corresponding generic method.
- Specified by:
previousDouble
in interface DoubleBidirectionalIterator
- Returns:
- the previous element in the iteration.
- See Also:
ListIterator.previous()
previous
public Double previous()
- Delegates to the corresponding type-specific method.
- Specified by:
previous
in interface BidirectionalIterator<Double>
- Returns:
- the previous element from the collection.
- See Also:
ListIterator.previous()
back
public int back(int n)
- This method just iterates the type-specific version of
previous()
for
at most n
times, stopping if BidirectionalIterator.hasPrevious()
becomes false.
- Specified by:
back
in interface DoubleBidirectionalIterator
- Specified by:
back
in interface ObjectBidirectionalIterator<Double>
- Parameters:
n
- the number of elements to skip back.
- Returns:
- the number of elements actually skipped.
- See Also:
Iterator.next()