org.expasy.jpl.commons.collection.stat
Class StatisticalCategory

java.lang.Object
  extended by java.lang.Number
      extended by org.expasy.jpl.commons.collection.stat.StatisticalCategory
All Implemented Interfaces:
Serializable

public final class StatisticalCategory
extends Number

A statistical category or class is an interval of values where data lie.

Version:
1.0
Author:
nikitin
See Also:
Serialized Form

Constructor Summary
StatisticalCategory(HistogramDataSet histo, double from, double to)
           
StatisticalCategory(HistogramDataSet histo, Interval interval)
           
 
Method Summary
 double doubleValue()
           
 float floatValue()
           
 double getCenter()
           
 double getFrequency()
           
 Interval getInterval()
           
 double[] getValues()
           
 int intValue()
           
 long longValue()
           
 String toString()
           
 void updateFrequency(double weight)
          Add the given value in this category.
 
Methods inherited from class java.lang.Number
byteValue, shortValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StatisticalCategory

public StatisticalCategory(HistogramDataSet histo,
                           Interval interval)

StatisticalCategory

public StatisticalCategory(HistogramDataSet histo,
                           double from,
                           double to)
Method Detail

updateFrequency

public final void updateFrequency(double weight)
Add the given value in this category.

Parameters:
value - the value to group in this category.
Throws:
IllegalArgumentException - if value does not belong to this interval.

getCenter

public final double getCenter()
Returns:
the center of this category.

getFrequency

public final double getFrequency()
Returns:
the mean number of observations in this interval.

getValues

public final double[] getValues()
Returns:
the observations of this interval.

doubleValue

public double doubleValue()
Specified by:
doubleValue in class Number

floatValue

public float floatValue()
Specified by:
floatValue in class Number

intValue

public int intValue()
Specified by:
intValue in class Number

longValue

public long longValue()
Specified by:
longValue in class Number

getInterval

public Interval getInterval()
Returns:
the class interval.

toString

public String toString()
Overrides:
toString in class Object


Copyright (c) 2012 Swiss Institute of Bioinformatics. All rights reserved.