|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectit.unimi.dsi.fastutil.shorts.AbstractShortIterator
public abstract class AbstractShortIterator
An abstract class facilitating the creation of type-specific iterators.
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
Constructor Summary | |
---|---|
protected |
AbstractShortIterator()
|
Method Summary | |
---|---|
Short |
next()
Delegates to the corresponding type-specific method. |
short |
nextShort()
Delegates to the corresponding generic method. |
void |
remove()
This method just throws an UnsupportedOperationException . |
int |
skip(int n)
This method just iterates the type-specific version of next() for at most
n times, stopping if Iterator.hasNext() becomes false. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.util.Iterator |
---|
hasNext |
Constructor Detail |
---|
protected AbstractShortIterator()
Method Detail |
---|
public short nextShort()
nextShort
in interface ShortIterator
Iterator.next()
public Short next()
next
in interface Iterator<Short>
public void remove()
UnsupportedOperationException
.
remove
in interface Iterator<Short>
public int skip(int n)
next()
for at most
n
times, stopping if Iterator.hasNext()
becomes false.
skip
in interface ShortIterator
n
- the number of elements to skip.
Iterator.next()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |