de.intarsys.tools.collection
Class SingleObjectEnumeration<T>

java.lang.Object
  extended by de.intarsys.tools.collection.SingleObjectEnumeration<T>
All Implemented Interfaces:
java.util.Enumeration<T>

public class SingleObjectEnumeration<T>
extends java.lang.Object
implements java.util.Enumeration<T>

An enumeration of a single object.


Constructor Summary
SingleObjectEnumeration(T single)
          EnumerationIterator constructor comment.
 
Method Summary
 boolean hasMoreElements()
           
 T nextElement()
           
 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

SingleObjectEnumeration

public SingleObjectEnumeration(T single)
EnumerationIterator constructor comment.

Parameters:
single -
Method Detail

hasMoreElements

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

nextElement

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

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. The behavior of an iterator is unspecified if the underlying collection is modified while the iteration is in progress in any way other than by calling this method.

Throws:
java.lang.UnsupportedOperationException - if the remove operation is not supported by this Iterator.