it.unimi.dsi.fastutil.floats
Class AbstractFloatBidirectionalIterator
java.lang.Object
it.unimi.dsi.fastutil.floats.AbstractFloatIterator
it.unimi.dsi.fastutil.floats.AbstractFloatBidirectionalIterator
- All Implemented Interfaces:
- BidirectionalIterator<java.lang.Float>, FloatBidirectionalIterator, FloatIterator, ObjectBidirectionalIterator<java.lang.Float>, ObjectIterator<java.lang.Float>, java.util.Iterator<java.lang.Float>
- Direct Known Subclasses:
- AbstractFloatListIterator, FloatIterators.UnmodifiableBidirectionalIterator
public abstract class AbstractFloatBidirectionalIterator
- extends AbstractFloatIterator
- implements FloatBidirectionalIterator
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.
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.util.Iterator |
hasNext, next, remove |
Methods inherited from interface java.util.Iterator |
hasNext, next, remove |
Methods inherited from interface java.util.Iterator |
hasNext, next, remove |
previousFloat
public float previousFloat()
- Delegates to the corresponding generic method.
- Specified by:
previousFloat
in interface FloatBidirectionalIterator
- Returns:
- the previous element in the iteration.
- See Also:
ListIterator.previous()
previous
public java.lang.Float previous()
- Delegates to the corresponding type-specific method.
- Specified by:
previous
in interface BidirectionalIterator<java.lang.Float>
- 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 FloatBidirectionalIterator
- Specified by:
back
in interface ObjectBidirectionalIterator<java.lang.Float>
- Parameters:
n
- the number of elements to skip back.
- Returns:
- the number of elements actually skipped.
- See Also:
Iterator.next()