it.unimi.dsi.fastutil.bytes
Class AbstractByteBidirectionalIterator
java.lang.Object
it.unimi.dsi.fastutil.bytes.AbstractByteIterator
it.unimi.dsi.fastutil.bytes.AbstractByteBidirectionalIterator
- All Implemented Interfaces:
- BidirectionalIterator, ByteBidirectionalIterator, ByteIterator, Iterator
- Direct Known Subclasses:
- AbstractByteListIterator
- public abstract class AbstractByteBidirectionalIterator
- extends AbstractByteIterator
- implements ByteBidirectionalIterator
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).
- See Also:
Iterator
previousByte
public byte previousByte()
- This method just invokes the generic version.
- Specified by:
previousByte
in interface ByteBidirectionalIterator
- Returns:
- the previous element from the collection.
- See Also:
ListIterator.previous()
previous
public Object previous()
- This method just invokes the type-specific version.
- Specified by:
previous
in interface BidirectionalIterator
- Returns:
- the previous element from the collection.
- See Also:
ListIterator.previous()
back
public int back(int n)
- This method just iterates
previous()
for
at most n
times, stopping if BidirectionalIterator.hasPrevious()
becomes false.
- Specified by:
back
in interface ByteBidirectionalIterator
- Parameters:
n
- the number of elements to skip back.
- Returns:
- the number of elements actually skipped.
- See Also:
Iterator.next()