001    package railo.runtime.util;
002    
003    import railo.runtime.PageContext;
004    import railo.runtime.type.Collection;
005    import railo.runtime.type.Query;
006    import railo.runtime.type.QueryColumn;
007    
008    /**
009     * Query Stack
010     */
011    public interface QueryStack {
012    
013        /**
014         * adds a Query to the Stack
015         * @param query 
016         */
017        public abstract void addQuery(Query query);
018    
019        /**
020         * removes a Query from Stack
021         */
022        public abstract void removeQuery();
023    
024        /**
025         * @return returns if stack is empty or not
026         */
027        public abstract boolean isEmpty();
028    
029        /**
030         * loop over all Queries and return value at first ocurrence
031         * @param key column name of the value to get
032         * @return value
033         * @deprecated use instead <code>{@link #getDataFromACollection(PageContext,String)}</code>
034         */
035        public abstract Object getDataFromACollection(String key);
036        
037        /**
038         * loop over all Queries and return value at first ocurrence
039         * @param key column name of the value to get
040         * @return value
041         */
042        public abstract Object getDataFromACollection(PageContext pc,String key);
043    
044        /**
045         * loop over all Queries and return value at first ocurrence
046         * @param key column name of the value to get
047         * @return value
048         * @deprecated use instead <code>{@link #getDataFromACollection(PageContext,Collection.Key)}</code>
049         */
050        public abstract Object getDataFromACollection(Collection.Key key);
051        
052        /**
053         * loop over all Queries and return value at first ocurrence
054         * @param key column name of the value to get
055         * @return value
056         */
057        public abstract Object getDataFromACollection(PageContext pc,Collection.Key key);
058    
059        /**
060         * loop over all Queries and return value as QueryColumn at first ocurrence
061         * @param key column name of the value to get
062         * @return value
063         */
064        public abstract QueryColumn getColumnFromACollection(String key);
065    
066        /**
067         * loop over all Queries and return value as QueryColumn at first ocurrence
068         * @param key column name of the value to get
069         * @return value
070         */
071        public abstract QueryColumn getColumnFromACollection(Collection.Key key);
072    
073        /**
074         * clear the collection stack
075         */
076        public abstract void clear();
077        
078        /**
079         * @return returns all queries in the stack
080         */
081        public Query[] getQueries();
082        
083        public QueryStack duplicate(boolean deepCopy);
084    
085    }