org.jaitools.numeric
Enum Statistic

java.lang.Object
  extended by java.lang.Enum<Statistic>
      extended by org.jaitools.numeric.Statistic
All Implemented Interfaces:
Serializable, Comparable<Statistic>

public enum Statistic
extends Enum<Statistic>

Constants for the statistics supported by the SampleStats and StreamingSampleStats classes.

Since:
1.0
Version:
$Id$
Author:
Michael Bedward

Enum Constant Summary
APPROX_MEDIAN
          Approximate median calculated with the 'remedian' algorithm of Rousseeuw et al.
MAX
          Maximum sample value
MEAN
          Arithmetic mean
MEDIAN
          Exact median
MIN
          Minimum sample value
RANGE
          Range (maximum - minimum)
SDEV
          Sample standard deviation
SUM
          Sum of valid values
VARIANCE
          Sample variance
 
Method Summary
static Statistic get(String name)
          Gets a Statistic constant by name (case-insensitive).
 String getDescription()
          Returns a brief description of the statistic
 boolean supportsIntegralResult()
          Tests if this statistic can return an integral result when working with integral sample data.
 String toString()
          Returns the short name of this statistic
static Statistic valueOf(String name)
          Returns the enum constant of this type with the specified name.
static Statistic[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

MEAN

public static final Statistic MEAN
Arithmetic mean


MEDIAN

public static final Statistic MEDIAN
Exact median


APPROX_MEDIAN

public static final Statistic APPROX_MEDIAN
Approximate median calculated with the 'remedian' algorithm of Rousseeuw et al. This is only used with StreamingSampleStats.


MIN

public static final Statistic MIN
Minimum sample value


MAX

public static final Statistic MAX
Maximum sample value


RANGE

public static final Statistic RANGE
Range (maximum - minimum)


SDEV

public static final Statistic SDEV
Sample standard deviation


SUM

public static final Statistic SUM
Sum of valid values


VARIANCE

public static final Statistic VARIANCE
Sample variance

Method Detail

values

public static Statistic[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (Statistic c : Statistic.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static Statistic valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

toString

public String toString()
Returns the short name of this statistic

Overrides:
toString in class Enum<Statistic>

getDescription

public String getDescription()
Returns a brief description of the statistic

Returns:

supportsIntegralResult

public boolean supportsIntegralResult()
Tests if this statistic can return an integral result when working with integral sample data.

Returns:
true if an integral result can be returned; false otherwise

get

public static Statistic get(String name)
Gets a Statistic constant by name (case-insensitive).

Parameters:
name - the statistic name
Returns:
a Statistic instance or null if the name was was not matched


Copyright © 2009-2013. All Rights Reserved.