public class IteratorIntIterator extends Object implements IntIterator
Number-valued
Iterator
to the IntIterator
interface.
This implementation delegates most methods
to the provided Iterator
implementation in the "obvious" way.| Constructor and Description |
|---|
IteratorIntIterator(Iterator iterator)
Creates an
IntIterator wrapping
the specified Iterator. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
hasNext()
Returns
true iff I have more elements. |
int |
next()
Returns the next element in me.
|
void |
remove()
Removes from my underlying collection the last
element
returned by me
(optional operation). |
static IntIterator |
wrap(Iterator iterator)
Create an
IntIterator wrapping
the specified Iterator. |
public IteratorIntIterator(Iterator iterator)
IntIterator wrapping
the specified Iterator.wrap(java.util.Iterator)public static IntIterator wrap(Iterator iterator)
IntIterator wrapping
the specified Iterator. When
the given iterator is null,
returns null.iterator - the (possibly null)
Iterator to wrapIntIterator wrapping the given
iterator, or null when iterator is
null.public boolean hasNext()
IntIteratortrue iff I have more elements.
(In other words, returns true iff
a subsequent call to next will return
an element rather than throwing an exception.)hasNext in interface IntIteratortrue iff I have more elementspublic int next()
IntIteratornext in interface IntIteratorpublic void remove()
IntIteratorreturned by me
(optional operation).remove in interface IntIteratorCopyright © 2002-2013 The Apache Software Foundation. All Rights Reserved.