public abstract class AbstractObjectIterator<K> extends Object implements ObjectIterator<K>
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| 修飾子 | コンストラクタと説明 |
|---|---|
protected |
AbstractObjectIterator() |
| 修飾子とタイプ | メソッドと説明 |
|---|---|
void |
remove()
This method just throws an
UnsupportedOperationException. |
int |
skip(int n)
This method just iterates the type-specific version of
Iterator.next() for at most
n times, stopping if Iterator.hasNext() becomes false. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEachRemaining, hasNext, nextpublic void remove()
UnsupportedOperationException.public int skip(int n)
Iterator.next() for at most
n times, stopping if Iterator.hasNext() becomes false.skip インタフェース内 ObjectIterator<K>n - the number of elements to skip.Iterator.next()Copyright © 2011–2016. All rights reserved.