BooleanIterator, java.util.Iterator<java.lang.Boolean>AbstractBooleanBidirectionalIterator, BooleanIterators.UnmodifiableIteratorpublic abstract class AbstractBooleanIterator extends java.lang.Object implements BooleanIterator
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 | Constructor | Description |
|---|---|---|
protected |
AbstractBooleanIterator() |
| Modifier and Type | Method | Description |
|---|---|---|
java.lang.Boolean |
next() |
Deprecated.
Please use the corresponding type-specific method instead.
|
boolean |
nextBoolean() |
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. |
public boolean nextBoolean()
nextBoolean in interface BooleanIteratorIterator.next()@Deprecated public java.lang.Boolean next()
next in interface java.util.Iterator<java.lang.Boolean>public void remove()
UnsupportedOperationException.remove in interface java.util.Iterator<java.lang.Boolean>public int skip(int n)
next()
for at most n times, stopping if Iterator.hasNext() becomes
false.skip in interface BooleanIteratorn - the number of elements to skip.Iterator.next()