org.apache.commons.collections.primitives.adapters
Class IteratorBooleanIterator

java.lang.Object
  extended by org.apache.commons.collections.primitives.adapters.IteratorBooleanIterator
All Implemented Interfaces:
BooleanIterator

public class IteratorBooleanIterator
extends Object
implements BooleanIterator

Adapts a Boolean-valued Iterator to the BooleanIterator interface.

This implementation delegates most methods to the provided Iterator implementation in the "obvious" way.

Since:
Commons Primitives 1.2
Version:
$Revision: 480462 $

Constructor Summary
IteratorBooleanIterator(Iterator iterator)
          Creates an BooleanIterator wrapping the specified Iterator.
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IteratorBooleanIterator

public IteratorBooleanIterator(Iterator iterator)
Creates an BooleanIterator wrapping the specified Iterator.

See Also:
wrap(java.util.Iterator)
Method Detail

wrap

public static BooleanIterator wrap(Iterator iterator)
Create an BooleanIterator wrapping the specified Iterator. When the given iterator is null, returns null.

Parameters:
iterator - the (possibly null) Iterator to wrap
Returns:
an BooleanIterator wrapping the given iterator, or null when iterator is null.

hasNext

public boolean hasNext()
Description copied from interface: BooleanIterator
Returns 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.)

Specified by:
hasNext in interface BooleanIterator
Returns:
true iff I have more elements

next

public boolean next()
Description copied from interface: BooleanIterator
Returns the next element in me.

Specified by:
next in interface BooleanIterator
Returns:
the next element in me

remove

public void remove()
Description copied from interface: BooleanIterator
Removes from my underlying collection the last element returned by me (optional operation).

Specified by:
remove in interface BooleanIterator


Copyright © 2002-2011 Apache Software Foundation. All Rights Reserved.