edu.umich.eecs.tac.props
Class KeyIterator<T>

java.lang.Object
  extended by edu.umich.eecs.tac.props.KeyIterator<T>
Type Parameters:
T - the key class
All Implemented Interfaces:
java.util.Iterator<T>

public class KeyIterator<T>
extends java.lang.Object
implements java.util.Iterator<T>

Key iterator provides an iteration method that wraps a keyed entry iterator and returns the keys of those entries.

Author:
Patrick Jordan

Constructor Summary
KeyIterator(java.util.Iterator<? extends KeyedEntry<? extends T>> delegateIterator)
          Create a new key iterator that delegates to the supplied iterator.
 
Method Summary
 boolean hasNext()
          Returns whether another key is available.
 T next()
          Returns tne next key.
 void remove()
          Throws an UnsupportedOperationException if called.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KeyIterator

public KeyIterator(java.util.Iterator<? extends KeyedEntry<? extends T>> delegateIterator)
Create a new key iterator that delegates to the supplied iterator.

Parameters:
delegateIterator - a new key iterator that delegates to the supplied iterator.
Method Detail

hasNext

public final boolean hasNext()
Returns whether another key is available. This will return true if the delegated iterator has another entry.

Specified by:
hasNext in interface java.util.Iterator<T>
Returns:
whether another key is available.

next

public final T next()
Returns tne next key.

Specified by:
next in interface java.util.Iterator<T>
Returns:
tne next key.

remove

public final void remove()
                  throws java.lang.UnsupportedOperationException
Throws an UnsupportedOperationException if called.

Specified by:
remove in interface java.util.Iterator<T>
Throws:
java.lang.UnsupportedOperationException - if the method is invoked.


Copyright © 2007-2009 Association for Trading Agent Research. All Rights Reserved.