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