Class SingleObjectEnumeration<T>

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

public class SingleObjectEnumeration<T> extends Object implements Enumeration<T>
An enumeration of a single object.
  • Constructor Details

    • SingleObjectEnumeration

      public SingleObjectEnumeration(T single)
      EnumerationIterator constructor comment.
      Parameters:
      single -
  • Method Details

    • hasMoreElements

      public boolean hasMoreElements()
      Specified by:
      hasMoreElements in interface Enumeration<T>
    • nextElement

      public T nextElement()
      Specified by:
      nextElement in interface 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:
      UnsupportedOperationException - if the remove operation is not supported by this Iterator.