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<Object> {
011    
012            private Iterator<Key> 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<Key> keys, Objects objs) {
020                    this.keys=keys;
021                    this.objs=objs;
022            }
023    
024            public boolean hasNext() {
025                    return keys.hasNext();
026            }
027    
028            @Override
029            public Object next() {
030                    return objs.get(ThreadLocalPageContext.get(),KeyImpl.toKey(keys.next(),null),null);
031            }
032    
033            public void remove() {
034                    throw new UnsupportedOperationException("this operation is not suppored");
035            }
036    
037    }