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