common
Class Statistics

java.lang.Object
  extended by common.Statistics

public class Statistics
extends java.lang.Object

Provides a tool for collecting statistics about the values of fields in the data set.

Author:
vohuudtr

Constructor Summary
Statistics()
          Constructs the object without initialization.
 
Method Summary
 void add(MultiFieldKey key, int quantity)
          Add explicitly a value with given quantity.
 void add(Record record)
          Add and parse the record, and update the statistics.
 void initialize(int size)
          Initializes the object with total number of distinct values in the data set.
 void print()
          Prints statistics to standard output stream.
 void print(java.io.OutputStream out)
          Prints statistics to given output stream.
 void print(java.lang.String filename)
          Print statistics to a given file.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Statistics

public Statistics()
Constructs the object without initialization.

Method Detail

initialize

public void initialize(int size)
Initializes the object with total number of distinct values in the data set.

Parameters:
size - number of distinct values in the data set.

add

public void add(Record record)
Add and parse the record, and update the statistics.

Parameters:
record - record to add.

add

public void add(MultiFieldKey key,
                int quantity)
Add explicitly a value with given quantity.

Parameters:
key -
quantity -

print

public void print(java.io.OutputStream out)
Prints statistics to given output stream.

Parameters:
out - output stream.

print

public void print()
Prints statistics to standard output stream.


print

public void print(java.lang.String filename)
Print statistics to a given file.

Parameters:
filename - output filename.