package railo.runtime.type.it;

import java.util.Iterator;

import railo.runtime.type.Collection;
import railo.runtime.type.Collection.Key;
import railo.runtime.type.KeyImpl;

public class CollectionIterator implements Iterator {

	private Iterator keys;
	private Collection coll;

	public CollectionIterator(Key[] keys, Collection coll) {
		this.keys=new KeyIterator(keys);
		this.coll=coll;
	}
	public CollectionIterator(Iterator keys, Collection coll) {
		this.keys=keys;
		this.coll=coll;
	}

	public boolean hasNext() {
		return keys.hasNext();
	}

	/**
	 * @see java.util.Iterator#next()
	 */
	public Object next() {
		return coll.get(KeyImpl.toKey(keys.next(),null),null);
	}

	public void remove() {
		throw new UnsupportedOperationException("this operation is not suppored");
	}

}

@@ -220,16 +220,24 @@
 Iterator
+%3CObject%3E
  %7B%0A%0A%09pri
@@ -245,24 +245,40 @@
 ate Iterator
+%3CCollection.Key%3E
  keys;%0A%09priv
@@ -448,16 +448,32 @@
 Iterator
+%3CCollection.Key%3E
  keys, C
@@ -678,22 +678,8 @@
 get(
-KeyImpl.toKey(
 keys
@@ -691,22 +691,16 @@
 (),null)
-,null)
 ;%0A%09%7D%0A%0A%09p

add generic types