This project has retired. For details please refer to its Attic page.
IteratorEnumeration (Tiles 2 2.2.2 API)

org.apache.tiles.util
Class IteratorEnumeration<E>

Package class diagram package IteratorEnumeration
java.lang.Object
  extended by org.apache.tiles.util.IteratorEnumeration<E>
Type Parameters:
E - The type of the enumerated elements.
All Implemented Interfaces:
Enumeration<E>

public class IteratorEnumeration<E>
extends Object
implements Enumeration<E>

Copied and modified from Apache Commons Collections 3.2.1.
Adapter to make an Iterator instance appear to be an Enumeration instance.

Since:
Commons Collections 1.0
Version:
$Revision: 797916 $ $Date: 2008-04-10 13:33:15 +0100 (Thu, 10 Apr 2008) $
Author:
James Strachan

Constructor Summary
IteratorEnumeration(Iterator<E> iterator)
          Constructs a new IteratorEnumeration that will use the given iterator.
 
Method Summary
 boolean hasMoreElements()
          Returns true if the underlying iterator has more elements.
 E nextElement()
          Returns the next element from the underlying iterator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IteratorEnumeration

public IteratorEnumeration(Iterator<E> iterator)
Constructs a new IteratorEnumeration that will use the given iterator.

Parameters:
iterator - the iterator to use
Method Detail

hasMoreElements

public boolean hasMoreElements()
Returns true if the underlying iterator has more elements.

Specified by:
hasMoreElements in interface Enumeration<E>
Returns:
true if the underlying iterator has more elements

nextElement

public E nextElement()
Returns the next element from the underlying iterator.

Specified by:
nextElement in interface Enumeration<E>
Returns:
the next element from the underlying iterator.
Throws:
NoSuchElementException - if the underlying iterator has no more elements


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