001    package com.allaire.cfx;
002    
003    import java.sql.ResultSet;
004    
005    
006    
007    
008    /**
009     * Alternative Implementation of Jeremy Allaire's Query Interface
010     */
011    public interface Query extends ResultSet {
012    
013            /**
014             * @return adds a row to resultset
015             */
016            public int addRow();
017    
018            /**
019             * returns index of a columnName
020             * @param coulmnName column name to get index for
021             * @return index of a columnName
022             */
023            public int getColumnIndex(String coulmnName);
024    
025            /**
026             * @return All column Names of resultset as string
027             * FUTURE change to getColumnNamesAsString();
028             */
029            public String[] getColumns();
030            
031            // FUTURE public String[] getColumnNamesAsString();
032            // FUTURE public Collection.Key[] getColumnNames();
033    
034    
035            /**
036             * returns one field of a Query as String
037             * @param row
038             * @param col
039             * @return data from query object
040             * @throws IndexOutOfBoundsException
041             */
042            public String getData(int row, int col) throws IndexOutOfBoundsException;
043    
044            /**
045             * @return returns name of the query
046             */
047            public String getName();
048    
049            /**
050             * @return returns row count
051             */
052            public int getRowCount();
053    
054            /**
055             * sets value at a defined position in Query
056             * @param row
057             * @param col
058             * @param value
059             * @throws IndexOutOfBoundsException
060             */
061            public void setData(int row, int col, String value)
062                            throws IndexOutOfBoundsException ;
063    
064    }