CoherenceTM v3.3
Copyright© 2000-2007 by Oracle Corporation

com.tangosol.util
Class ConverterEnumerator

java.lang.Object
  extended by com.tangosol.util.Base
      extended by com.tangosol.util.ConverterEnumerator
All Implemented Interfaces:
Enumeration, Iterator

public class ConverterEnumerator
extends Base
implements Enumeration, Iterator

Provide an implementation of an enumerator which converts each of the items which it enumerates.

Version:
1.00, 2002.02.07
Author:
Cameron Purdy

Field Summary
protected  Converter m_conv
          Converter to convert each item.
protected  Iterator m_iter
          Iterator of Objects to convert.
 
Constructor Summary
ConverterEnumerator(Enumeration enmr, Converter conv)
          Construct the Converter enumerator based on an Enumeration.
ConverterEnumerator(Iterator iter, Converter conv)
          Construct the Converter enumerator based on an Iterator.
ConverterEnumerator(Object[] aoItem, Converter conv)
          Construct the Converter enumerator based on an array of objects.
 
Method Summary
 boolean hasMoreElements()
          Tests if this enumeration contains more elements.
 boolean hasNext()
          Determine if this Iterator contains more elements.
 Object next()
          Returns the next element of this Iterator.
 Object nextElement()
          Get the next element in the enumeration.
 void remove()
          Remove the last-returned element that was returned by the Iterator.
 

Field Detail

m_iter

protected Iterator m_iter
Iterator of Objects to convert.


m_conv

protected Converter m_conv
Converter to convert each item.

Constructor Detail

ConverterEnumerator

public ConverterEnumerator(Enumeration enmr,
                           Converter 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 iter,
                           Converter 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 conv)
Construct the Converter enumerator based on an array of objects.

Parameters:
aoItem - array of objects to enumerate
conv - a Converter
Method Detail

hasMoreElements

public boolean hasMoreElements()
Tests if this enumeration contains more elements.

Specified by:
hasMoreElements in interface Enumeration
Returns:
false if the enumeration has been exhausted

nextElement

public Object nextElement()
Get the next element in the enumeration.

Specified by:
nextElement in interface Enumeration
Returns:
the next element of this enumeration

hasNext

public boolean hasNext()
Determine if this Iterator contains more elements.

Specified by:
hasNext in interface Iterator
Returns:
true if the Iterator contains more elements, false otherwise

next

public Object next()
Returns the next element of this Iterator.

Specified by:
next in interface Iterator
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

CoherenceTM v3.3
Copyright© 2000-2007 by Oracle Corporation