ptolemy.actor.gt.data
Class CombinedCollection.Iterator

java.lang.Object
  extended by ptolemy.actor.gt.data.CombinedCollection.Iterator
All Implemented Interfaces:
java.util.Iterator<E>
Enclosing class:
CombinedCollection<E>

private class CombinedCollection.Iterator
extends java.lang.Object
implements java.util.Iterator<E>

The iterator for iterating elements in this collection.

Since:
Ptolemy II 8.0
Version:
$Id: CombinedCollection.java 57046 2010-01-27 23:35:53Z cxh $
Author:
Thomas Huining Feng
Accepted Rating:
Red (tfeng)
Proposed Rating:
Yellow (tfeng)

Field Summary
private  java.util.Iterator<java.util.Collection<? extends E>> _collectionIterator
          The iterator to iterate the component collections.
private  java.util.Iterator<? extends E> _elementIterator
          The iterator to iterate the elements of the chosen component collection.
 
Constructor Summary
CombinedCollection.Iterator()
          Construct an iterator.
 
Method Summary
private  void _ensureNext()
          Move the pointer to the next element in the collection.
 boolean hasNext()
          Test whether there is a next element.
 E next()
          Return the next element, if any, or throw a NoSuchElementException if the end of the collection has already been reached.
 void remove()
          Throw a runtime exception because removal is not supported.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_collectionIterator

private java.util.Iterator<java.util.Collection<? extends E>> _collectionIterator
The iterator to iterate the component collections.


_elementIterator

private java.util.Iterator<? extends E> _elementIterator
The iterator to iterate the elements of the chosen component collection.

Constructor Detail

CombinedCollection.Iterator

CombinedCollection.Iterator()
Construct an iterator.

Method Detail

hasNext

public boolean hasNext()
Test whether there is a next element.

Specified by:
hasNext in interface java.util.Iterator<E>
Returns:
true if there is a next element.

next

public E next()
Return the next element, if any, or throw a NoSuchElementException if the end of the collection has already been reached.

Specified by:
next in interface java.util.Iterator<E>
Returns:
The next element.

remove

public void remove()
Throw a runtime exception because removal is not supported.

Specified by:
remove in interface java.util.Iterator<E>

_ensureNext

private void _ensureNext()
Move the pointer to the next element in the collection.