Class HistogramGenerator

java.lang.Object
  extended by HistogramGenerator

public class HistogramGenerator
extends Object

Class to generate a histogram

Author:
Mark Guzdial, Barb Ericson

Constructor Summary
HistogramGenerator()
           
 
Method Summary
 void countValues(String inputFile, int factor)
          Method to read a set of values from the inputFile create even bins based on the passed factor.
 void countValuesForKeys(String inputFile, double[] keys)
          Method to read a set of values from the inputFile and create bins based on the array of keys.
static void genNewNormal()
          Method to generate the normal histogram
static void genNormal()
          Method to generate the normal histogram
static void genUniform()
          Generate the histogram from the uniform data
static void main(String[] args)
          Main method for testing
 void writeFile(String fileName)
          Method to output the keys and values in the histogram to a file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HistogramGenerator

public HistogramGenerator()
Method Detail

countValuesForKeys

public void countValuesForKeys(String inputFile,
                               double[] keys)
Method to read a set of values from the inputFile and create bins based on the array of keys. This will count the number of values in each bin. Any value larger than the last key will be put in the last bin.

Parameters:
inputFile - the file to read from
an - array of key values to use

countValues

public void countValues(String inputFile,
                        int factor)
Method to read a set of values from the inputFile create even bins based on the passed factor. This will count the number of values in each bin.

Parameters:
inputFile - the file to read from
factor - the factor to use to break the values into bins

writeFile

public void writeFile(String fileName)
Method to output the keys and values in the histogram to a file

Parameters:
fileName - the name of the file to write to

genUniform

public static void genUniform()
Generate the histogram from the uniform data


genNormal

public static void genNormal()
Method to generate the normal histogram


genNewNormal

public static void genNewNormal()
Method to generate the normal histogram


main

public static void main(String[] args)
Main method for testing