/*Data1.java copyright claim: Permission is hereby granted to any individual or institution for use, copying, or redistribution of Data1.java code and documentation provided that such code and documentation are not sold for profit and the following copyright notice is retained in the code and documentation. Copyright (c) held by Sunhee Kwon and Dianne Cook All Rights Reserved This code is provided "as is" without any warranty of any kind. We don't warrant, guarantee or make any representations regarding the correctness, reliability, currentness of this code. We welcome your questions and comments, and request that you share any modifications with us. Sunhee Kwon shkwon@iastate.edu Dianne Cook dicook@iastate.edu */ import java.awt.*; import java.awt.event.*; import java.io.*; import java.util.*; import java.lang.*; import java.net.*; public class Data1 extends Object{ String filename; double x[][]; private DataInputStream is = null; private DataInputStream is2 = null; int ncols, nrows; boolean under_brush[]; boolean new_under_brush = false; static double rclass[]; public void readData(String filen) throws FileNotFoundException{ filename = filen; int i=0, k=0; boolean keep_reading = true; try { try { FileInputStream fl = new FileInputStream(filename); is = new DataInputStream(fl); } catch(Exception e) { System.out.println("Error: "+e); System.exit(1); } Reader r = new BufferedReader(new InputStreamReader(is)); StreamTokenizer d = new StreamTokenizer(r); d.resetSyntax(); d.wordChars(0,255); d.whitespaceChars(0,' '); d.eolIsSignificant(true); java.util.Vector v = new java.util.Vector(); while(d.nextToken() == StreamTokenizer.TT_EOL); if (d.ttype == StreamTokenizer.TT_EOF) throw new java.io.IOException("Unexpected EOF on matrix read."); do { v.addElement(Double.valueOf(d.sval)); } while (d.nextToken() == StreamTokenizer.TT_WORD); int n = v.size(); double row[] = new double[n]; for (int jj=0; jj=n) throw new java.io.IOException ("Row "+v.size()+" is too long."); row[j++] = Double.valueOf(d.sval).doubleValue(); }while (d.nextToken() == StreamTokenizer.TT_WORD); if (j