//TestHist.java import java.io.*; public class TestHist { public static void main (String argv[] ) { Histogram h; File f; DataInputStream d; FileInputStream fi; String buf; int n, i; double x, rf; rf = 1.0; h = new Histogram (15, rf ); // f = new File( "hist.dat" ); try { fi = new FileInputStream( "jhist.dat" ); // fi = new FileInputStream( f ); d = new DataInputStream( fi ); do { try { buf = d.readLine(); if ( buf == null ) break; if ( buf.length() <= 0 ) break; } catch ( IOException e ) { System.out.println("Error reading file " + e.toString() ); break; } x = java.lang.Double.valueOf( buf ).doubleValue(); h.AddDatum( x ); n = h.TotalPoints(); System.out.println("Add " + x + "..H has " + n + " items"); } while( n < 99 ); } catch ( IOException e ) { System.out.println("Error opening file " + e.toString() ); } //Draw Histogram for (i=0;i