001    package railo.runtime.type.cfc;
002    
003    import java.util.Iterator;
004    import java.util.Map.Entry;
005    
006    import railo.runtime.type.Collection.Key;
007    import railo.runtime.type.it.EntryIterator;
008    
009    public class ComponentAccessEntryIterator extends EntryIterator implements Iterator<Entry<Key, Object>> {
010    
011            private ComponentAccess cfc;
012            private int access;
013    
014            public ComponentAccessEntryIterator(ComponentAccess cfc, Key[] keys, int access) { 
015                    super(cfc,keys);
016                    this.cfc=cfc;
017                    this.access=access;
018            }
019    
020            @Override
021            public Entry<Key, Object> next() {
022                    Key key = keys[pos++];
023                    if(key==null) return null;
024                    return new CAEntryImpl(cfc,key,access);
025            }
026            
027            public class CAEntryImpl extends EntryImpl implements Entry<Key, Object> {
028                    
029                    private ComponentAccess cfc;
030                    private int access;
031    
032                    public CAEntryImpl(ComponentAccess cfc, Key key, int access) {
033                            super(cfc,key);
034                            this.cfc=cfc;
035                            this.access=access;
036                    }
037    
038                    @Override
039                    public Object getValue() {
040                            return cfc.get(access,key,null);
041                    }
042    
043                    @Override
044                    public Object setValue(Object value) {
045                            return cfc.setEL(key, value);
046                    }
047    
048            }
049    }