Skip navigation links

Oracle® Coherence Java API Reference
Release 3.7.0.0

E18683-01


com.tangosol.util
Class ChainedEnumerator

java.lang.Object
  extended by com.tangosol.util.Base
      extended by com.tangosol.util.ChainedEnumerator

All Implemented Interfaces:
java.util.Enumeration, java.util.Iterator

public class ChainedEnumerator
extends Base
implements java.util.Enumeration, java.util.Iterator

Provide an enumerator which enumerates the contents of multiple enumerators.

Author:
cp 1998.08.07

Field Summary
protected  int m_iNextIter
          The next Iterator (index into the m_listIter) to iterate.
protected  java.util.Iterator m_iterCurrent
          The current Iterator.
protected  java.util.List m_listIter
          The Iterators.

 

Constructor Summary
ChainedEnumerator()
          Construct an enumerator that will first enumerate multiple enumerators.
ChainedEnumerator(java.util.Enumeration enmrFirst)
          Construct an enumerator that will first enumerate the passed Enumeration.
ChainedEnumerator(java.util.Enumeration[] aEnum)
          Construct an enumerator that will first enumerate the Enumerations passed in the array as if they were together a single enumerator.
ChainedEnumerator(java.util.Enumeration enmrFirst, java.util.Enumeration enmrSecond)
          Construct an enumerator that will first enumerate the first Enumeration and then will enumerate the second Enumeration as if they were together a single Enumeration.
ChainedEnumerator(java.util.Iterator iterator)
          Construct an enumerator that will first enumerate the passed Iterator.
ChainedEnumerator(java.util.Iterator[] aIterator)
          Construct an enumerator that will first enumerate the Iterators passed in the array as if they were together a single enumerator.
ChainedEnumerator(java.util.Iterator iterFirst, java.util.Iterator iterSecond)
          Construct an enumerator that will first enumerate the first Iterator and then will enumerate the second Iterator as if they were together a single Iterator.

 

Method Summary
 void addEnumeration(java.util.Enumeration enmr)
          Add the Enumeration to the end of the chain.
 void addIterator(java.util.Iterator iterator)
          Add the Iterator to the end of the chain.
protected  java.util.Iterator getIterator()
          Get the current or next enumeration in the list
protected  java.util.Iterator getRecentIterator()
          Get the recently used iterator, if any.
 boolean hasMoreElements()
          Tests if this enumeration contains more elements.
 boolean hasNext()
          Tests if this Iterator contains more elements.
 java.lang.Object next()
          Returns the next element of this Iterator.
 java.lang.Object nextElement()
          Returns the next element of this enumeration.
 void remove()
          Remove the last-returned element that was returned by the Iterator.

 

Field Detail

m_listIter

protected java.util.List m_listIter
The Iterators.

m_iNextIter

protected int m_iNextIter
The next Iterator (index into the m_listIter) to iterate.

m_iterCurrent

protected java.util.Iterator m_iterCurrent
The current Iterator.

Constructor Detail

ChainedEnumerator

public ChainedEnumerator()
Construct an enumerator that will first enumerate multiple enumerators.

ChainedEnumerator

public ChainedEnumerator(java.util.Enumeration enmrFirst)
Construct an enumerator that will first enumerate the passed Enumeration.
Parameters:
enmrFirst - the first Enumeration

ChainedEnumerator

public ChainedEnumerator(java.util.Iterator iterator)
Construct an enumerator that will first enumerate the passed Iterator.
Parameters:
iterator - the first Iterator

ChainedEnumerator

public ChainedEnumerator(java.util.Enumeration enmrFirst,
                         java.util.Enumeration enmrSecond)
Construct an enumerator that will first enumerate the first Enumeration and then will enumerate the second Enumeration as if they were together a single Enumeration.
Parameters:
enmrFirst - the first Enumeration
enmrSecond - the second Enumeration

ChainedEnumerator

public ChainedEnumerator(java.util.Iterator iterFirst,
                         java.util.Iterator iterSecond)
Construct an enumerator that will first enumerate the first Iterator and then will enumerate the second Iterator as if they were together a single Iterator.
Parameters:
iterFirst - the first Iterator
iterSecond - the second Iterator

ChainedEnumerator

public ChainedEnumerator(java.util.Enumeration[] aEnum)
Construct an enumerator that will first enumerate the Enumerations passed in the array as if they were together a single enumerator.
Parameters:
aEnum - an array of Enumerations

ChainedEnumerator

public ChainedEnumerator(java.util.Iterator[] aIterator)
Construct an enumerator that will first enumerate the Iterators passed in the array as if they were together a single enumerator.
Parameters:
aIterator - an array of Iterators

Method Detail

addEnumeration

public void addEnumeration(java.util.Enumeration enmr)
Add the Enumeration to the end of the chain.
Parameters:
enmr - an Enumeration

addIterator

public void addIterator(java.util.Iterator iterator)
Add the Iterator to the end of the chain.
Parameters:
iterator - an Iterator

hasMoreElements

public boolean hasMoreElements()
Tests if this enumeration contains more elements.
Specified by:
hasMoreElements in interface java.util.Enumeration
Returns:
true if the enumeration contains more elements, false otherwise

nextElement

public java.lang.Object nextElement()
Returns the next element of this enumeration.
Specified by:
nextElement in interface java.util.Enumeration
Returns:
the next element in the enumeration

hasNext

public boolean hasNext()
Tests if this Iterator contains more elements.
Specified by:
hasNext in interface java.util.Iterator
Returns:
true if the Iterator contains more elements, false otherwise

next

public java.lang.Object next()
Returns the next element of this Iterator.
Specified by:
next in interface java.util.Iterator
Returns:
the next element in the Iterator

remove

public void remove()
Remove the last-returned element that was returned by the Iterator. This method always throws UnsupportedOperationException because the Iterator is immutable.
Specified by:
remove in interface java.util.Iterator

getIterator

protected java.util.Iterator getIterator()
Get the current or next enumeration in the list
Returns:
the current enumeration.

getRecentIterator

protected java.util.Iterator getRecentIterator()
Get the recently used iterator, if any.
Returns:
the iterator that was most recently used

Skip navigation links

Oracle® Coherence Java API Reference
Release 3.7.0.0

E18683-01


Copyright © 2000, 2011, Oracle and/or its affiliates. All rights reserved.