001/**
002 *
003 * Copyright (c) 2014, the Railo Company Ltd. All rights reserved.
004 *
005 * This library is free software; you can redistribute it and/or
006 * modify it under the terms of the GNU Lesser General Public
007 * License as published by the Free Software Foundation; either 
008 * version 2.1 of the License, or (at your option) any later version.
009 * 
010 * This library is distributed in the hope that it will be useful,
011 * but WITHOUT ANY WARRANTY; without even the implied warranty of
012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
013 * Lesser General Public License for more details.
014 * 
015 * You should have received a copy of the GNU Lesser General Public 
016 * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
017 * 
018 **/
019package lucee.runtime.type.query;
020
021import java.util.Iterator;
022
023import lucee.runtime.exp.PageException;
024import lucee.runtime.type.Collection;
025import lucee.runtime.type.Query;
026import lucee.runtime.type.QueryImpl;
027import lucee.runtime.type.util.StructSupport;
028import lucee.runtime.type.util.StructUtil;
029
030public class QueryStruct extends StructSupport {
031
032        private QueryImpl qi=null;
033        private Query qry;
034        private int row;
035
036        public QueryStruct(Query qry, int row) {
037                this.qry=qry;
038                this.row=row;
039        }
040
041        @Override
042        public void clear() {
043                // TODO Auto-generated method stub
044
045        }
046
047        @Override
048        public Object remove(Key key) throws PageException {
049                // TODO Auto-generated method stub
050                return null;
051        }
052
053        @Override
054        public Object removeEL(Key key) {
055                // TODO Auto-generated method stub
056                return null;
057        }
058
059        @Override
060        public Object set(Key key, Object value) throws PageException {
061                // TODO Auto-generated method stub
062                return null;
063        }
064
065        @Override
066        public Object setEL(Key key, Object value) {
067                // TODO Auto-generated method stub
068                return null;
069        }
070
071        @Override
072        public int size() {
073                return qry.keys().length;
074        }
075
076        @Override
077        public Key[] keys() {
078                return qry.keys();
079        }
080
081        @Override
082        public Object get(Key key) throws PageException {
083                return qry.getAt(key, row);
084        }
085
086        @Override
087        public Object get(Key key, Object defaultValue) {
088                return qry.getAt(key, row,defaultValue);
089        }
090
091        @Override
092        public Collection duplicate(boolean deepCopy) {
093                return StructUtil.duplicate(this, deepCopy);
094        }
095
096        @Override
097        public boolean containsKey(Key key) {
098                return qry.containsKey(key);
099        }
100
101        @Override
102        public Iterator<Key> keyIterator() {
103                return qry.keyIterator();
104        }
105
106        @Override
107        public Iterator<Object> valueIterator() {
108                return null;//new QueryValueIterator(qry, row);
109        }
110
111        @Override
112        public Iterator<Entry<Key, Object>> entryIterator() {
113                return null;//new QueryEntryItrator(qry, row);
114        }
115
116}