com.mucommander.util
Class Enumerator

java.lang.Object
  extended by com.mucommander.util.Enumerator
All Implemented Interfaces:
java.util.Iterator

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

Converts an Enumeration into an Iterator.

Author:
Nicolas Rinaudo

Constructor Summary
Enumerator(java.util.Enumeration e)
          Creates a new enumerator from the specified enumeration.
 
Method Summary
 boolean hasNext()
          Returns true if the iterator has more elements.
 java.lang.Object next()
          Returns the next element in the iteration.
 void remove()
          Operation not supported.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Enumerator

public Enumerator(java.util.Enumeration e)
Creates a new enumerator from the specified enumeration.

Parameters:
e - enumeration that needs to be treated as an iterator.
Method Detail

hasNext

public boolean hasNext()
Returns true if the iterator has more elements. (In other words, returns true if next would return an element rather than throwing an exception.)

Specified by:
hasNext in interface java.util.Iterator
Returns:
true if the iterator has more elements, false otherwise.

next

public java.lang.Object next()
                      throws java.util.NoSuchElementException
Returns the next element in the iteration.

Specified by:
next in interface java.util.Iterator
Returns:
the next element in the iteration.
Throws:
java.util.NoSuchElementException - if there is no next element in the iteration.

remove

public void remove()
Operation not supported.

Specified by:
remove in interface java.util.Iterator
Throws:
java.lang.UnsupportedOperationException - whenever this method is called.


This file is part of muCommander - Copyright (C) 2002-2008 Maxence Bernard