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