Package com.tangosol.util
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 EnumerationT
- 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.
-
-
Constructor Summary
Constructors Constructor Description ConverterEnumerator(Object[] aoItem, Converter<F,T> conv)
Construct the Converter enumerator based on an array of objects.ConverterEnumerator(Enumeration<F> enmr, Converter<F,T> conv)
Construct the Converter enumerator based on an Enumeration.ConverterEnumerator(Iterator<F> iter, Converter<F,T> conv)
Construct the Converter enumerator based on an Iterator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
hasMoreElements()
Tests if this enumeration contains more elements.boolean
hasNext()
Determine if this Iterator contains more elements.T
next()
Returns the next element of this Iterator.T
nextElement()
Get the next element in the enumeration.void
remove()
Remove the last-returned element that was returned by the Iterator.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Enumeration
asIterator
-
Methods inherited from interface java.util.Iterator
forEachRemaining
-
-
-
-
Constructor Detail
-
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 convertconv
- 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 convertconv
- a Converter
-
-
Method Detail
-
hasMoreElements
public boolean hasMoreElements()
Tests if this enumeration contains more elements.- Specified by:
hasMoreElements
in interfaceEnumeration<F>
- Returns:
- false if the enumeration has been exhausted
-
nextElement
public T nextElement()
Get the next element in the enumeration.- Specified by:
nextElement
in interfaceEnumeration<F>
- Returns:
- the next element of this enumeration
-
hasNext
public boolean hasNext()
Determine if this Iterator contains more elements.
-
next
public T next()
Returns the next element of this Iterator.
-
-