|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.aliasi.util.Iterators.PrimitiveInt
public abstract static class Iterators.PrimitiveInt
A Iterators.PrimitiveInt is an integer iterator that
also allows objects to be accessed as primitive int
values.
The method next() returns an Integer,
whereas nextPrimitive() returns a primitive int value. Using either one will advanced the iterator to the
next element.
Implementation Note: Using the standard iterator
implementation as Integer requires boxing of the
primitive values as objects. Therefore, use the method
nextPrimitive() wherever possible.
| Constructor Summary | |
|---|---|
Iterators.PrimitiveInt()
|
|
| Method Summary | |
|---|---|
abstract boolean |
hasNext()
Returns true if there is another integer in the
iteration. |
Integer |
next()
Returns the next integer result. |
abstract int |
nextPrimitive()
Returns the next primitive integer. |
void |
remove()
Throws unsupported operation exception. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Iterators.PrimitiveInt()
| Method Detail |
|---|
public abstract int nextPrimitive()
public abstract boolean hasNext()
true if there is another integer in the
iteration.
hasNext in interface Iterator<Integer>true if there is another integer in the
iteration.public void remove()
remove in interface Iterator<Integer>UnsupportedOperationException - Always.public Integer next()
Implementation Note: Requires boxing the
primitive int returned by nextPrimitive().
next in interface Iterator<Integer>
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||