org.apache.commons.collections.iterators
Class IteratorEnumeration
java.lang.Object
|
+--org.apache.commons.collections.iterators.IteratorEnumeration
- All Implemented Interfaces:
- Enumeration
- public class IteratorEnumeration
- extends Object
- implements Enumeration
Adapter to make an Iterator
instance appear to be an Enumeration
instances
- Since:
- 1.0
- Author:
- James Strachan
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
IteratorEnumeration
public IteratorEnumeration()
- Constructs a new
IteratorEnumeration
that will not
function until setIterator
is
invoked.
IteratorEnumeration
public IteratorEnumeration(Iterator iterator)
- Constructs a new
IteratorEnumeration
that will use
the given iterator.
- Parameters:
iterator
- the iterator to use
getIterator
public Iterator getIterator()
- Returns the underlying iterator.
- Returns:
- the underlying iterator
hasMoreElements
public boolean hasMoreElements()
- Returns true if the underlying iterator has more elements.
- Specified by:
hasMoreElements
in interface Enumeration
- Returns:
- true if the underlying iterator has more elements
nextElement
public Object nextElement()
- Returns the next element from the underlying iterator.
- Specified by:
nextElement
in interface Enumeration
- Returns:
- the next element from the underlying iterator.
- Throws:
NoSuchElementException
- if the underlying iterator has no
more elements
setIterator
public void setIterator(Iterator iterator)
- Sets the underlying iterator.
- Parameters:
iterator
- the new underlying iterator
Copyright © 2001-2002 Apache Software Foundation. Documenation generated November 10 2002.