org.openbp.common.util.iterator
Class IteratorEnumeration

java.lang.Object
  extended by org.openbp.common.util.iterator.IteratorEnumeration
All Implemented Interfaces:
java.util.Enumeration

public class IteratorEnumeration
extends java.lang.Object
implements java.util.Enumeration

Enumerates from an iterated object.

Author:
Andreas Putz

Constructor Summary
IteratorEnumeration(java.util.Iterator iterator)
          Constructor.
 
Method Summary
 boolean hasMoreElements()
          Tests if this enumeration contains more elements.
 java.lang.Object nextElement()
          Returns the next element of this enumeration if this enumeration object has at least one more element to provide.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IteratorEnumeration

public IteratorEnumeration(java.util.Iterator iterator)
Constructor.

Parameters:
iterator - The iterator to enumerate
Method Detail

hasMoreElements

public boolean hasMoreElements()
Tests if this enumeration contains more elements.

Specified by:
hasMoreElements in interface java.util.Enumeration
Returns:
true if and only if this enumeration object contains at least one more element to provide; false otherwise.

nextElement

public java.lang.Object nextElement()
Returns the next element of this enumeration if this enumeration object has at least one more element to provide.

Specified by:
nextElement in interface java.util.Enumeration
Returns:
the next element of this enumeration
Throws:
NoSuchElementException - if no more elements exist.


Copyright © 2011. All Rights Reserved.