SigPath

org.sigpath.util
Class BenchmarkStatistics

java.lang.Object
  extended by org.sigpath.util.BenchmarkStatistics

public class BenchmarkStatistics
extends Object

Class that collects data and can present statistic information about the collected data right now the Class can only handle integers.

Version:
1.0
Author:
Ulf Schenk

Constructor Summary
BenchmarkStatistics(String name, String keytext, String valuetext)
           
 
Method Summary
 int get(int key)
          Returns the value for a certain key.
 int inc(int key)
          Increments the value for a certain key by one.
 String mean()
          Report operation: Calculates the mean or 'average' of the collected elements
 String percentageGEKey(int keyToSearch)
          Report operation: Calculates how much collected elements are greater or equal then a certain search key
 String percentageGTKey(int keyToSearch)
          Report operation: Calculates how much collected elements are greater then a certain search key
 String percentageLEKey(int keyToSearch)
          Report operation: Calculates how much collected elements are less or equal then a certain search key
 String percentageLTKey(int keyToSearch)
          Report operation: Calculates how much collected elements are less then a certain search key
 int put(int key, int value)
          Sets the value for a certain key.
 void toFile()
          Report operation: Function to write all key value pairs to a File.
 String toString()
          Report operation: Function to print all key value pairs to a String in sorted order.
 int totalNumberOfElements()
          Report operation: The total number of elements counted.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BenchmarkStatistics

public BenchmarkStatistics(String name,
                           String keytext,
                           String valuetext)
Method Detail

get

public int get(int key)
Returns the value for a certain key.

Returns:
int - the value for the searched key or 0

put

public int put(int key,
               int value)
Sets the value for a certain key.

Returns:
int - the previous value of the key or 0

inc

public int inc(int key)
Increments the value for a certain key by one.

Returns:
int - the new value of the key

percentageGEKey

public String percentageGEKey(int keyToSearch)
Report operation: Calculates how much collected elements are greater or equal then a certain search key

Returns:
String - a percentage value

percentageGTKey

public String percentageGTKey(int keyToSearch)
Report operation: Calculates how much collected elements are greater then a certain search key

Returns:
string - a percentage value

percentageLTKey

public String percentageLTKey(int keyToSearch)
Report operation: Calculates how much collected elements are less then a certain search key

Returns:
String - a percentage value

percentageLEKey

public String percentageLEKey(int keyToSearch)
Report operation: Calculates how much collected elements are less or equal then a certain search key

Returns:
String - a percentage value

mean

public String mean()
Report operation: Calculates the mean or 'average' of the collected elements

Returns:
String - the mean value

totalNumberOfElements

public int totalNumberOfElements()
Report operation: The total number of elements counted.

Returns:
int - the total number

toString

public String toString()
Report operation: Function to print all key value pairs to a String in sorted order.

Overrides:
toString in class Object
Returns:
String - the output String

toFile

public void toFile()
Report operation: Function to write all key value pairs to a File.


SigPath

Copyright © 2002-2005 Institute for Computational Biomedicine, All Rights Reserved.