org.apache.commons.resources.util
Class IteratorEnumeration

java.lang.Object
  extended by org.apache.commons.resources.util.IteratorEnumeration
All Implemented Interfaces:
Enumeration, Iterator

public class IteratorEnumeration
extends Object
implements Iterator, Enumeration

Two way Adaptor class for java.util.Iterator and java.util.Enumeration.


Constructor Summary
IteratorEnumeration(Enumeration enumeration)
          Construct an instance which wraps an Enumeration.
IteratorEnumeration(Iterator iterator)
          Construct an instance which wraps an Iterator.
 
Method Summary
 boolean hasMoreElements()
          Indicates whether the wrapped Iterator/Enumeration has more elements.
 boolean hasNext()
          Indicates whether the wrapped Iterator/Enumeration has more elements.
 Object next()
          Returns the next element in the wrapped Iterator/Enumeration.
 Object nextElement()
          Returns the next element in the wrapped Iterator/Enumeration.
 void remove()
          remove() is not supported.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IteratorEnumeration

public IteratorEnumeration(Iterator iterator)
Construct an instance which wraps an Iterator.

Parameters:
iterator - The Iterator to wrap.

IteratorEnumeration

public IteratorEnumeration(Enumeration enumeration)
Construct an instance which wraps an Enumeration.

Parameters:
enumeration - The Enumeration to wrap.
Method Detail

remove

public void remove()
remove() is not supported.

Specified by:
remove in interface Iterator
Throws:
UnsupportedOperationException - always.

hasNext

public boolean hasNext()
Indicates whether the wrapped Iterator/Enumeration has more elements.

Specified by:
hasNext in interface Iterator
Returns:
true if the wrapped Iterator/Enumeration has more elements.

next

public Object next()
Returns the next element in the wrapped Iterator/Enumeration.

Specified by:
next in interface Iterator
Returns:
the next element.

hasMoreElements

public boolean hasMoreElements()
Indicates whether the wrapped Iterator/Enumeration has more elements.

Specified by:
hasMoreElements in interface Enumeration
Returns:
true if the wrapped Iterator/Enumeration has more elements.

nextElement

public Object nextElement()
Returns the next element in the wrapped Iterator/Enumeration.

Specified by:
nextElement in interface Enumeration
Returns:
the next element.


Copyright © 2001-2010 The Apache Software Foundation. All Rights Reserved.