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;
020
021import lucee.runtime.exp.PageException;
022
023/**
024 * Interface for a simple Iterator
025 */
026public interface Iterator {
027
028        /**
029        * set the intern pointer of the iterator to the next position, 
030        * return true if next position exist otherwise false.
031        * @return       boolean
032        * @throws PageException
033        * @deprecated use instead <code>{@link #next(int)}</code>
034        */
035        public boolean next()throws PageException;
036        
037        /**
038        * set the intern pointer of the iterator to the next position, 
039        * return true if next position exist otherwise false.
040        * @return       boolean
041        * @throws PageException
042        */
043        public boolean next(int pid)throws PageException;
044
045        public boolean previous(int pid);
046        
047        /**
048        * reset ther intern pointer
049        * @throws PageException
050        * @deprecated use instead <code>{@link #reset(int)}</code>
051        */
052        public void reset()throws PageException;
053        
054        /**
055        *
056        * reset ther intern pointer
057        * @throws PageException
058        */
059        public void reset(int pid)throws PageException;
060        
061        /**
062        * return recordcount of the iterator object
063        * @return       int 
064        */
065        public int getRecordcount();
066        
067        
068        /**
069        * return the current position of the internal pointer
070        * @return       int 
071        */
072        public int getCurrentrow(int pid);
073
074        /**
075        *
076        * set the internal pointer to defined position
077        * @param index
078        * @return       int 
079        * @throws PageException
080        */
081        public boolean go(int index, int pid)throws PageException;
082        
083        /**
084         * @return returns if iterator is empty or not
085         */
086        public boolean isEmpty();
087        
088        //public ArrayList column(String strColumn)throws PageException;
089        
090        //public String[] row(int number);
091}