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.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionConverterEnumerator
(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.Construct the Converter enumerator based on an Iterator. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Tests if this enumeration contains more elements.boolean
hasNext()
Determine if this Iterator contains more elements.next()
Returns the next element of this Iterator.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
-
Field Details
-
m_iter
Iterator of Objects to convert. -
m_conv
Converter to convert each item.
-
-
Constructor Details
-
ConverterEnumerator
Construct the Converter enumerator based on an Enumeration.- Parameters:
enmr
- java.util.Enumeration of objects to convertconv
- a Converter
-
ConverterEnumerator
Construct the Converter enumerator based on an Iterator.- Parameters:
iter
- java.util.Iterator of objects to convertconv
- a Converter
-
ConverterEnumerator
Construct the Converter enumerator based on an array of objects.- Parameters:
aoItem
- array of objects to enumerateconv
- a Converter
-
-
Method Details
-
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
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
Returns the next element of this Iterator. -
remove
public void remove()Remove the last-returned element that was returned by the Iterator.
-