pt.tumba.ngram.compression
Class TestSet

java.lang.Object
  extended by pt.tumba.ngram.compression.TestSet

 class TestSet
extends java.lang.Object

Package local helper class to compute statistics for a set of compression experiments. Stores original and coded bytes, average and cumulative compression and speeds. Pretty printing is through report.

Author:
Bruno Martins
See Also:
TestStatistics

Field Summary
private  java.util.HashMap _tests
          Storage for all of the tests.
 
Constructor Summary
TestSet()
           
 
Method Summary
(package private)  void clear()
          Clears the test set by removing all results.
(package private)  void record(java.lang.String name, int originalBytes, int codedBytes, long encodeTime, long decodeTime)
          Records an outcome for a compression for a given test name, specifying original and coded bytes, along with encode and decode times.
 java.lang.String toString()
          Returns a String version of the Test report.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_tests

private java.util.HashMap _tests
Storage for all of the tests.

Constructor Detail

TestSet

TestSet()
Method Detail

record

void record(java.lang.String name,
            int originalBytes,
            int codedBytes,
            long encodeTime,
            long decodeTime)
Records an outcome for a compression for a given test name, specifying original and coded bytes, along with encode and decode times.

Parameters:
name - Name of test.
originalBytes - Number of bytes in input.
codedBytes - Number of bytes after compression.
encodeTime - Number of milliseconds required to encode.
decodeTime - Number of milliseconds required to decode.

toString

public java.lang.String toString()
Returns a String version of the Test report.

Overrides:
toString in class java.lang.Object

clear

void clear()
Clears the test set by removing all results.