public abstract class AbstractByteIterator extends Object implements ByteIterator
To create a type-specific iterator you need both a method returning the next element as primitive type and a method returning the next element as an object. However, if you inherit from this class you need just one (anyone).
This class implements also a trivial version of skip(int) that uses
type-specific methods; moreover, remove() will throw an
UnsupportedOperationException.
Iterator| Modifier and Type | Method and Description |
|---|---|
Byte |
next()
Deprecated.
Please use the corresponding type-specific method instead.
|
byte |
nextByte()
Returns the next element as a primitive type.
|
void |
remove()
This implementation always throws an
UnsupportedOperationException. |
int |
skip(int n)
Skips the given number of elements.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEachRemaining, hasNextpublic byte nextByte()
This implementation delegates to the corresponding generic method.
nextByte in interface ByteIteratorIterator.next()@Deprecated public Byte next()
This implementation delegates to the corresponding type-specific method.
next in interface ByteIteratornext in interface Iterator<Byte>public void remove()
This implementation always throws an
UnsupportedOperationException.
public int skip(int n)
The effect of this call is exactly the same as that of calling
ByteIterator.next() for n times (possibly stopping if
Iterator.hasNext() becomes false).
This implementaion iterates the type-specific version of next()
for at most n times, stopping if Iterator.hasNext() becomes
false.
skip in interface ByteIteratorn - the number of elements to skip.Iterator.next()