1 20 package com.nilostep.xlsql.database; 21 22 import com.nilostep.xlsql.sql.xlSqlSelect; 23 24 import java.io.File ; 25 26 27 import java.util.logging.Logger ; 28 29 30 35 public abstract class xlFile { 36 protected static final Logger logger = Logger.getAnonymousLogger(); protected java.io.File directory; 37 protected String subFolderName; 38 protected String fileName; 39 protected boolean validAsSqlTable; 40 protected int columnCount; 41 protected int rowCount; 42 protected String [] columnNames; 43 protected String [] columnTypes; 44 protected boolean[] isChanged = new boolean[3]; 45 46 protected xlFile(File dir, String folder, String name) throws xlException { 47 directory = dir; 48 subFolderName = folder; 49 fileName = name; 50 validAsSqlTable = readFile(); 51 } 52 53 protected xlFile(File dir, String folder, String name, boolean bdirty) { 54 directory = dir; 55 subFolderName = folder; 56 fileName = name; 57 validAsSqlTable = true; 58 rowCount = 1; 59 isChanged[xlConstants.ADD] = bdirty; 60 } 61 62 protected abstract boolean readFile() throws xlException; 63 64 72 public abstract void close(Object subOut, xlSqlSelect select) 73 throws xlException; 74 75 public abstract String [][] getValues() throws xlException; 76 77 80 void addRow() { 81 rowCount++; 82 } 83 84 89 java.lang.String [] getColumnNames() { 90 return this.columnNames; 91 } 92 93 100 boolean getIsChanged(int i) { 101 return isChanged[i]; 102 } 103 104 109 int getRows() { 110 return rowCount; 111 } 112 113 118 java.lang.String getSName() { 119 return fileName; 120 } 121 122 127 java.lang.String [] getColumnTypes() { 128 return this.columnTypes; 129 } 130 131 136 public boolean isValid() { 137 return validAsSqlTable; 138 } 139 140 146 public void setIsChanged(int i, boolean val) { 147 isChanged[i] = val; 148 } 149 150 } | Popular Tags |