org.hibernate.validator.util
Class IteratorEnumeration<T>

java.lang.Object
  extended by org.hibernate.validator.util.IteratorEnumeration<T>
Type Parameters:
T - The enumerated type.
All Implemented Interfaces:
Enumeration<T>

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

An Enumeration implementation, that wraps an Iterator. Can be used to integrate older APIs working with enumerations with iterators.

Author:
Gunnar Morling

Constructor Summary
IteratorEnumeration(Iterator<T> source)
          Creates a new IterationEnumeration.
 
Method Summary
 boolean hasMoreElements()
           
 T nextElement()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IteratorEnumeration

public IteratorEnumeration(Iterator<T> source)
Creates a new IterationEnumeration.

Parameters:
source - The source iterator. Must not be 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 © 2007-2010 Red Hat Middleware, LLC. All Rights Reserved