public class IteratorShortIterator extends Object implements ShortIterator
Number-valued
Iterator
to the ShortIterator
interface.
This implementation delegates most methods
to the provided Iterator
implementation in the "obvious" way.
| Constructor and Description |
|---|
IteratorShortIterator(Iterator iterator)
Creates an
ShortIterator wrapping
the specified Iterator. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
hasNext()
Returns
true iff I have more elements. |
short |
next()
Returns the next element in me.
|
void |
remove()
Removes from my underlying collection the last
element
returned by me
(optional operation). |
static ShortIterator |
wrap(Iterator iterator)
Create an
ShortIterator wrapping
the specified Iterator. |
public IteratorShortIterator(Iterator iterator)
ShortIterator wrapping
the specified Iterator.wrap(java.util.Iterator)public static ShortIterator wrap(Iterator iterator)
ShortIterator wrapping
the specified Iterator. When
the given iterator is null,
returns null.iterator - the (possibly null)
Iterator to wrapShortIterator wrapping the given
iterator, or null when iterator is
null.public boolean hasNext()
ShortIteratortrue 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 ShortIteratortrue iff I have more elementspublic short next()
ShortIteratornext in interface ShortIteratorpublic void remove()
ShortIteratorreturned by me
(optional operation).remove in interface ShortIteratorCopyright © 2002–2025 The Apache Software Foundation. All rights reserved.