Class ConverterCollections.ConverterEnumerator<F,T>

java.lang.Object
com.tangosol.util.ConverterCollections.ConverterEnumerator<F,T>
Type Parameters:
F - the type of elements in the underlying Enumeration
T - the type that the elements should be converted to
All Implemented Interfaces:
Enumeration<T>, Iterator<T>
Direct Known Subclasses:
ConverterCollections.ConverterLongArray.ConverterLongArrayIterator, ConverterEnumerator
Enclosing class:
ConverterCollections

public static class ConverterCollections.ConverterEnumerator<F,T> extends Object implements Enumeration<T>, Iterator<T>
Provide an implementation of an enumerator which converts each of the items which it enumerates.
  • Field Details

    • m_iter

      protected Iterator<F> m_iter
      Iterator of Objects to convert.
    • m_conv

      protected Converter<F,T> m_conv
      Converter to convert each item.
  • Constructor Details

    • ConverterEnumerator

      public ConverterEnumerator(Enumeration<F> enmr, Converter<F,T> conv)
      Construct the Converter enumerator based on an Enumeration.
      Parameters:
      enmr - java.util.Enumeration of objects to convert
      conv - a Converter
    • ConverterEnumerator

      public ConverterEnumerator(Iterator<F> iter, Converter<F,T> conv)
      Construct the Converter enumerator based on an Iterator.
      Parameters:
      iter - java.util.Iterator of objects to convert
      conv - a Converter
    • ConverterEnumerator

      public ConverterEnumerator(Object[] aoItem, Converter<F,T> conv)
      Construct the Converter enumerator based on an array of objects.
      Parameters:
      aoItem - array of objects to enumerate
      conv - a Converter
  • Method Details

    • hasMoreElements

      public boolean hasMoreElements()
      Tests if this enumeration contains more elements.
      Specified by:
      hasMoreElements in interface Enumeration<F>
      Returns:
      false if the enumeration has been exhausted
    • nextElement

      public T nextElement()
      Get the next element in the enumeration.
      Specified by:
      nextElement in interface Enumeration<F>
      Returns:
      the next element of this enumeration
    • hasNext

      public boolean hasNext()
      Determine if this Iterator contains more elements.
      Specified by:
      hasNext in interface Iterator<F>
      Returns:
      true if the Iterator contains more elements, false otherwise
    • next

      public T next()
      Returns the next element of this Iterator.
      Specified by:
      next in interface Iterator<F>
      Returns:
      the next element in the Iterator
    • remove

      public void remove()
      Remove the last-returned element that was returned by the Iterator.
      Specified by:
      remove in interface Iterator<F>