org.openanzo.util
Class CompositeIterator<T>

java.lang.Object
  extended by org.openanzo.util.CompositeIterator<T>
Type Parameters:
T - Type of objects within the iterators
All Implemented Interfaces:
java.util.Iterator<T>, MutableIterator<T>

public class CompositeIterator<T>
extends java.lang.Object
implements MutableIterator<T>

Combine 2 iterators into a composite iterator

Author:
Lee Feigenbaum ( feigenbl@us.ibm.com )

Constructor Summary
CompositeIterator(java.util.Iterator<? extends T> it1, java.util.Iterator<? extends T> it2)
          Create a composite of 2 iterators
 
Method Summary
 boolean hasNext()
           
 T next()
           
 void remove()
           
 void set(T newVal)
          Replaces the last element accessed via the iterator (usually via .next()) with newVal.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompositeIterator

public CompositeIterator(java.util.Iterator<? extends T> it1,
                         java.util.Iterator<? extends T> it2)
Create a composite of 2 iterators

Parameters:
it1 - First iterator
it2 - Second iterator
Method Detail

hasNext

public boolean hasNext()
Specified by:
hasNext in interface java.util.Iterator<T>

next

public T next()
Specified by:
next in interface java.util.Iterator<T>

remove

public void remove()
Specified by:
remove in interface java.util.Iterator<T>

set

public void set(T newVal)
Description copied from interface: MutableIterator
Replaces the last element accessed via the iterator (usually via .next()) with newVal.

Specified by:
set in interface MutableIterator<T>
Parameters:
newVal - The new value to replace for the previously accessed element in the iteration.


Copyright © 2007 Cambridge Semantics Inc.. All Rights Reserved.