/*******************************************************************************
 * Copyright (c) 2013 Eric Dill -- eddill@ncsu.edu. North Carolina State University. All rights reserved.
 * This program and the accompanying materials
 * are made available under the terms of the GNU Public License v3.0
 * which accompanies this distribution, and is available at
 * http://www.gnu.org/licenses/gpl.html
 * 
 * Contributors:
 *     Eric Dill -- eddill@ncsu.edu - initial API and implementation
 * 	James D. Martin -- jdmartin@ncsu.edu - Principal Investigator
 ******************************************************************************/
package dataFileTypes;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.Scanner;

public class ASC implements ImageFile {
	private final static int FIRST_DATA_ROW = 6;
	private int rows, columns;
	public ASC(int rows, int columns) {
		this.rows = rows;
		this.columns = columns;
	}
	@Override
	public double[][] readFile(File aFile, int[] bounds) {
		int x0 = bounds[0];
		int y0 = bounds[1];
		int x1 = bounds[2];
		int y1 = bounds[3];
		
		double[][] data = new double[(x1-x0)][(y1-y0)];
		FileInputStream fis = null;
		Scanner s = null;
		
		int rowIdx = 0;
		int columnIdx = 0;
		
		try {
			fis = new FileInputStream(aFile);
			s = new Scanner(fis);
		} catch(FileNotFoundException fnfe) {
			System.err.println(fnfe);
			System.exit(1);
		}
		// skip the header
		while(rowIdx < FIRST_DATA_ROW) { 
			s.nextLine();
			rowIdx++;
		}
		// reset the row index
		rowIdx = 0;
		return null;
	}
	@Override
	public double[][] readFile(File aFile) {
		return readFile(aFile, new int[] {rows, columns} );
	}

}

@@ -681,38 +681,13 @@
 ort 
-java.io.File;%0D%0Aimport java.
 io.
+My
 File
@@ -700,16 +700,18 @@
 tream;%0D%0A
+%0D%0A
 import j
@@ -721,33 +721,16 @@
 .io.File
-NotFoundException
 ;%0D%0Aimpor
@@ -1035,207 +1035,98 @@
 %0D%0A%09%09
-int x0 = bounds%5B0%5D;%0D%0A%09%09int y0 = bounds%5B1%5D;%0D%0A%09%09int x1 = bounds%5B2%5D;%0D%0A%09%09int y1 = bounds%5B3%5D;%0D%0A%09%09%0D%0A%09%09double%5B%5D%5B%5D data = new double%5B(x1-x0)%5D%5B(y1-y0)%5D;%0D%0A%09%09FileInputStream fis = null;%0D%0A%09%09Scanner s = null
+throw new UnsupportedOperationException(%22readFile in class ASC is not implemented%22)
 ;%0D%0A%09%09
+/*
 %0D%0A%09%09
@@ -1148,44 +1148,27 @@
 %0D%0A%09%09
-int columnIdx = 0;%0D%0A%09%09%0D%0A%09%09try %7B%0D%0A%09%09%09
+MyFileInputStream m
 fis 
@@ -1173,16 +1173,18 @@
 s = new 
+My
 FileInpu
@@ -1206,126 +1206,38 @@
 %0D%0A%09%09
-%09s = new Scanner(fis);%0D%0A%09%09%7D catch(FileNotFoundException fnfe) %7B%0D%0A%09%09%09System.err.println(fnfe);%0D%0A%09%09%09System.exit(1);%0D%0A%09%09%7D
+Scanner s = mfis.getScanner();
 %0D%0A%09%09
@@ -1330,16 +1330,53 @@
 ;%0D%0A%09%09%7D%0D%0A
+%09%09// read the rest of the data file%0D%0A
 %09%09// res
@@ -1408,16 +1408,33 @@
 x = 0;%0D%0A
+%09%09mfis.close();%0D%0A
 %09%09return
@@ -1441,16 +1441,22 @@
  null;%0D%0A
+%09%09*/%0D%0A
 %09%7D%0D%0A%09@Ov

throw exception for not implemented function