com.sun.faban.driver.util.timermeter
Class MeasurementGroupsCluster

java.lang.Object
  extended by com.sun.faban.driver.util.timermeter.MeasurementGroupsCluster
All Implemented Interfaces:
Serializable

public class MeasurementGroupsCluster
extends Object
implements Serializable

A cluster which consists of key-value pairs that "aggregate" same-valued cluster elements. That is, instead of containing two items with the value 10, this cluster contains one entry with key 10 and value 2. Elements cannot be removed from the cluster. TODO optimise through "lazy computation" of median value and slot size

Author:
Michael Kuperberg TODO test me TODO integrate with WEKA and similar?
See Also:
Serialized Form

Constructor Summary
MeasurementGroupsCluster()
           
MeasurementGroupsCluster(Long key, Integer value)
           
MeasurementGroupsCluster(SortedMap<Long,Integer> clusterElements)
           
 
Method Summary
 double addData(Long key, Integer value)
          TODO check for negatives?
 double addData(Map<Long,Integer> keyValueMap)
           
 int getClassesNumberInCluster()
           
 long getClusterGroupSizeMaximum()
           
 double getClusterGroupSizeMean()
           
 long getClusterGroupSizeMedian()
           
 long getClusterGroupSizeMinimum()
           
 long getClusterGroupSizeSum()
           
 long getClusterValueMaximum()
          //TODO test me
 double getClusterValueMean()
           
 double getClusterValueMedian()
          TODO more effective median *re*computation? --> think about it! TODO test me
 long getClusterValueMinimum()
          TODO test me
 long getClusterValueSum()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MeasurementGroupsCluster

public MeasurementGroupsCluster()

MeasurementGroupsCluster

public MeasurementGroupsCluster(Long key,
                                Integer value)

MeasurementGroupsCluster

public MeasurementGroupsCluster(SortedMap<Long,Integer> clusterElements)
Method Detail

addData

public double addData(Long key,
                      Integer value)
TODO check for negatives?

Parameters:
key -
value -
Returns:

addData

public double addData(Map<Long,Integer> keyValueMap)

getClassesNumberInCluster

public int getClassesNumberInCluster()

getClusterGroupSizeMaximum

public long getClusterGroupSizeMaximum()

getClusterGroupSizeMean

public double getClusterGroupSizeMean()

getClusterGroupSizeMedian

public long getClusterGroupSizeMedian()

getClusterGroupSizeMinimum

public long getClusterGroupSizeMinimum()

getClusterGroupSizeSum

public long getClusterGroupSizeSum()

getClusterValueMaximum

public long getClusterValueMaximum()
//TODO test me

Returns:

getClusterValueMean

public double getClusterValueMean()

getClusterValueMedian

public double getClusterValueMedian()
TODO more effective median *re*computation? --> think about it! TODO test me

Returns:

getClusterValueMinimum

public long getClusterValueMinimum()
TODO test me

Returns:

getClusterValueSum

public long getClusterValueSum()

toString

public String toString()
Overrides:
toString in class Object