org.apache.commons.collections.iterators
Class IteratorEnumeration
java.lang.Objectorg.apache.commons.collections.iterators.IteratorEnumeration
- Enumeration
public class IteratorEnumeration
extends java.lang.Object
implements Enumeration
Adapter to make an Iterator instance appear to be
an Enumeration instance.
$Revision: 155406 $ $Date: 2005-02-26 12:55:26 +0000 (Sat, 26 Feb 2005) $
Iterator | getIterator()- Returns the underlying iterator.
|
boolean | hasMoreElements()- Returns true if the underlying iterator has more elements.
|
Object | nextElement()- Returns the next element from the underlying iterator.
|
void | setIterator(Iterator iterator)- Sets the underlying iterator.
|
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.
iterator - the iterator to use
getIterator
public Iterator getIterator()
Returns the underlying iterator.
hasMoreElements
public boolean hasMoreElements()
Returns true if the underlying iterator has more elements.
- true if the underlying iterator has more elements
nextElement
public Object nextElement()
Returns the next element from the underlying iterator.
- the next element from the underlying iterator.
setIterator
public void setIterator(Iterator iterator)
Sets the underlying iterator.
iterator - the new underlying iterator
Copyright © 2001-2015 Apache Software Foundation. All Rights Reserved.