Changeset 245
- Timestamp:
- Mar 13, 2007, 4:19:22 PM (16 years ago)
- Location:
- trunk/se/lu/onk/BaseFile/src/basefile
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/se/lu/onk/BaseFile/src/basefile/BASEFileException.java
r149 r245 43 43 super(e); 44 44 } 45 46 public BASEFileException(String message, Throwable e) 47 { 48 super(message, e); 49 } 45 50 } -
trunk/se/lu/onk/BaseFile/src/basefile/BASEFileReader.java
r186 r245 214 214 */ 215 215 public String[] readDataRow(int nbr) 216 throws IOException, TooFewFieldsException, TooManyFieldsException216 throws BASEFileException, TooFewFieldsException, TooManyFieldsException 217 217 { 218 218 String[] vec = new String[nbr]; … … 223 223 throw new TooFewFieldsException("Too few fields in " + section.getType() + ", line " + str.getLineNumber()); 224 224 } 225 if (!readLine() || dataEnd) return null; 226 227 int tok = buf.indexOf("\t"), otok = 0; 228 229 while (tok < buf.length()) 230 { 231 tok = buf.indexOf("\t", otok); 232 if (tok == -1) 233 { 234 tok = buf.length(); 235 } 236 vec[vec.length - nbr] = buf.substring(otok, tok); 237 otok = tok + 1; 238 nbr--; 225 try 226 { 227 if (!readLine() || dataEnd) return null; 228 229 int tok = buf.indexOf("\t"), otok = 0; 230 231 while (tok < buf.length()) 232 { 233 tok = buf.indexOf("\t", otok); 234 if (tok == -1) 235 { 236 tok = buf.length(); 237 } 238 vec[vec.length - nbr] = buf.substring(otok, tok); 239 otok = tok + 1; 240 nbr--; 241 } 242 } 243 catch (Exception e) 244 { 245 throw new BASEFileException("At line " + str.getLineNumber(), e); 239 246 } 240 247
Note: See TracChangeset
for help on using the changeset viewer.