de.fu_berlin.ties.eval
Class ValueSummary

java.lang.Object
  extended by de.fu_berlin.ties.eval.ValueSummary
All Implemented Interfaces:
StorableContainer

public class ValueSummary
extends Object
implements StorableContainer

Creates StatisticalSummary for any number of items ("keys") that occur zero or more times in any number of runs ("identifiers"). See the method descriptions for details.

Instances of this class are not thread-safe and must be synchronized externally, if required.

Version:
$Revision: 1.4 $, $Date: 2006/10/21 16:04:11 $, $Author: siefkes $
Author:
Christian Siefkes

Constructor Summary
ValueSummary()
          Creates a new instance.
 
Method Summary
 void add(String identifier, Bag bag)
          Adds a set of counts (a bag) to the statistics.
 SortedMap<Object,org.apache.commons.math.stat.descriptive.StatisticalSummary> calculateSummaries()
          Will calculate a statistical summary for each object contained in at least one of the bags added to this instance.
 void storeEntries(FieldContainer fContainer)
          Writes all relevant information to a field container for serialization.
 String toString()
          Returns a compact string representation of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ValueSummary

public ValueSummary()
Creates a new instance.

Method Detail

add

public void add(String identifier,
                Bag bag)
         throws IllegalStateException
Adds a set of counts (a bag) to the statistics.

Parameters:
identifier - how to refer to this bag
bag - the set of counts to add
Throws:
IllegalStateException - if calculateSummaries() (or storeEntries(FieldContainer) has already been invoked on this instance

calculateSummaries

public SortedMap<Object,org.apache.commons.math.stat.descriptive.StatisticalSummary> calculateSummaries()
Will calculate a statistical summary for each object contained in at least one of the bags added to this instance. After invoking this method, this object is immutable -- any further calls to add(String, Bag) will yield an IllegalStateException.

Returns:
the calculated summaries

storeEntries

public void storeEntries(FieldContainer fContainer)
Writes all relevant information to a field container for serialization. This implementation invokes calculateSummaries() (if necessary) and stores the mean, sum, and standard deviation as well as all individual counts for each added key. Keys are serialized in alphabetic order.

Specified by:
storeEntries in interface StorableContainer
Parameters:
fContainer - fContainer the field container to fill

toString

public String toString()
Returns a compact string representation of this object.

Overrides:
toString in class Object
Returns:
a string representation of this object


Copyright © 2003-2007 Christian Siefkes. All Rights Reserved.