org.slim3.struts.test
Class IteratorEnumeration<T>

java.lang.Object
  extended by org.slim3.struts.test.IteratorEnumeration<T>
Type Parameters:
T - the type
All Implemented Interfaces:
Enumeration<T>

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

A class to use Iterator as Enumeration.

Since:
3.0
Author:
higa

Field Summary
protected  Iterator<T> iterator
          The original iterator.
 
Constructor Summary
IteratorEnumeration(Iterator<T> iterator)
          Constructor.
 
Method Summary
 boolean hasMoreElements()
           
 T nextElement()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

iterator

protected Iterator<T> iterator
The original iterator.

Constructor Detail

IteratorEnumeration

public IteratorEnumeration(Iterator<T> iterator)
                    throws NullPointerException
Constructor.

Parameters:
iterator - the iterator
Throws:
NullPointerException - if the iterator parameter is null
Method Detail

hasMoreElements

public boolean hasMoreElements()
Specified by:
hasMoreElements in interface Enumeration<T>

nextElement

public T nextElement()
Specified by:
nextElement in interface Enumeration<T>


Copyright © 2008-2009 The Slim3 project. All Rights Reserved.