001    package railo.runtime.type.it;
002    
003    import java.util.Iterator;
004    
005    import railo.runtime.type.Collection;
006    import railo.runtime.type.Collection.Key;
007    
008    public class CollectionIterator implements Iterator<Object> {
009    
010            private Iterator<Collection.Key> keys;
011            private Collection coll;
012    
013            public CollectionIterator(Key[] keys, Collection coll) {
014                    this.keys=new KeyIterator(keys);
015                    this.coll=coll;
016            }
017            public CollectionIterator(Iterator<Collection.Key> keys, Collection coll) {
018                    this.keys=keys;
019                    this.coll=coll;
020            }
021    
022            public boolean hasNext() {
023                    return keys.hasNext();
024            }
025    
026            @Override
027            public Object next() {
028                    return coll.get(keys.next(),null);
029            }
030    
031            public void remove() {
032                    throw new UnsupportedOperationException("this operation is not suppored");
033            }
034    
035    }