org.openbp.common.util.iterator
Class EnumerationIterator

java.lang.Object
  extended by org.openbp.common.util.iterator.EnumerationIterator
All Implemented Interfaces:
java.util.Iterator

public class EnumerationIterator
extends java.lang.Object
implements java.util.Iterator

Enumerates from an iterated object.

Author:
Peter Kalmbach

Constructor Summary
EnumerationIterator(java.util.Enumeration enumeration)
          Constructor.
 
Method Summary
 boolean hasNext()
          Tests if this enumeration contains more elements.
 java.lang.Object next()
          Returns the next element of this enumeration if this enumeration object has at least one more element to provide.
 void remove()
          Removes from the underlying collection the last element returned by the iterator (optional operation).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EnumerationIterator

public EnumerationIterator(java.util.Enumeration enumeration)
Constructor.

Parameters:
enumeration - The enumeration to iterate
Method Detail

hasNext

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

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

next

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

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

remove

public void remove()
Removes from the underlying collection the last element returned by the iterator (optional operation). This method can be called only once per call to next.

Specified by:
remove in interface java.util.Iterator
Throws:
java.lang.UnsupportedOperationException - The remove operation is not supported by this Iterator.


Copyright © 2011. All Rights Reserved.