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