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

java.lang.Object
  extended byorg.apache.commons.collections.primitives.adapters.CharIteratorIterator
All Implemented Interfaces:
Iterator

public class CharIteratorIterator
extends Object
implements Iterator

Adapts an CharIterator to the Iterator interface.

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

Since:
Commons Primitives 1.0
Version:
$Revision: 1.3 $ $Date: 2003/10/16 20:49:38 $
Author:
Rodney Waldhoff

Field Summary
private  CharIterator _iterator
           
 
Constructor Summary
CharIteratorIterator(CharIterator iterator)
          Creates an Iterator wrapping the specified CharIterator.
 
Method Summary
 boolean hasNext()
           
 Object next()
           
 void remove()
           
static Iterator wrap(CharIterator iterator)
          Create an Iterator wrapping the specified CharIterator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_iterator

private CharIterator _iterator
Constructor Detail

CharIteratorIterator

public CharIteratorIterator(CharIterator iterator)
Creates an Iterator wrapping the specified CharIterator.

See Also:
wrap(org.apache.commons.collections.primitives.CharIterator)
Method Detail

wrap

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

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

hasNext

public boolean hasNext()
Specified by:
hasNext in interface Iterator

next

public Object next()
Specified by:
next in interface Iterator

remove

public void remove()
Specified by:
remove in interface Iterator


Copyright (c) 2002-2003 - Apache Software Foundation