org.geotools.math
Class Statistics.Delta

java.lang.Object
  extended byorg.geotools.math.Statistics
      extended byorg.geotools.math.Statistics.Delta
All Implemented Interfaces:
java.lang.Cloneable, org.opengis.util.Cloneable, java.io.Serializable
Enclosing class:
Statistics

public static class Statistics.Delta
extends Statistics

Hold some statistics about a series of sample values and the difference between them. Given a series of sample values s0, s1, s2, s3..., this class computes statistics in the same way than Statistics and additionnaly computes statistics for s1-s0, s2-s1, s3-s2..., which are stored in a delta statistics object.

Version:
$Id: Statistics.java 17672 2006-01-19 00:25:55Z desruisseaux $
Author:
Martin Desruisseaux
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class org.geotools.math.Statistics
Statistics.Delta
 
Constructor Summary
Statistics.Delta()
          Construct an initially empty set of statistics.
Statistics.Delta(Statistics delta)
          Construct an initially empty set of statistics using the specified object for delta statistics.
 
Method Summary
 void add(double sample)
          Update statistics for the specified sample.
 void add(long sample)
          Update statistics for the specified sample.
 void add(Statistics stats)
          Update statistics with all samples from the specified .
 java.lang.Object clone()
          Returns a clone of this statistics.
 boolean equals(java.lang.Object obj)
          Test this statistics with the specified object for equality.
 Statistics getDeltaStatistics()
          Returns the statistics about difference between consecutives values.
 int hashCode()
          Returns a hash code value for this statistics.
 void reset()
          Reset the statistics to their initial NaN values.
 
Methods inherited from class org.geotools.math.Statistics
count, countNaN, maximum, mean, minimum, range, rms, standardDeviation, toString, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Statistics.Delta

public Statistics.Delta()
Construct an initially empty set of statistics. All statistical values are initialized to Double.NaN.


Statistics.Delta

public Statistics.Delta(Statistics delta)
Construct an initially empty set of statistics using the specified object for delta statistics. This method allows chaining different kind of statistics objects. For example, one could write:
 new Statistics.Delta(new Statistics.Delta());
 
Which would compute statistics of sample values, statistics of difference between consecutive sample values, and statistics of difference of difference between consecutive sample values. Other kinds of Statistics object could be chained as well.

Method Detail

getDeltaStatistics

public Statistics getDeltaStatistics()
Returns the statistics about difference between consecutives values. Given a series of sample values s0, s1, s2, s3..., this is statistics for s1-s0, s2-s1, s3-s2...,


reset

public void reset()
Reset the statistics to their initial NaN values. This method reset this object state as if it was just created.

Overrides:
reset in class Statistics

add

public void add(double sample)
Update statistics for the specified sample. The delta statistics are updated with sample - samplelast value, where samplelast is the last value given to the previous call of an method.

Overrides:
add in class Statistics
Parameters:
sample - The sample value. NaN values are ignored.
See Also:
Statistics.add(long), Statistics.add(Statistics)

add

public void add(long sample)
Update statistics for the specified sample. The delta statistics are updated with sample - samplelast value, where samplelast is the last value given to the previous call of an method.

Overrides:
add in class Statistics
Parameters:
sample - The sample value.
See Also:
Statistics.add(double), Statistics.add(Statistics)

add

public void add(Statistics stats)
         throws java.lang.ClassCastException
Update statistics with all samples from the specified . Invoking this method is equivalent (except for rounding errors) to invoking add for all samples that were added to . The argument must be an instance of .

Overrides:
add in class Statistics
Parameters:
stats - The statistics to be added to , or if none.
Throws:
java.lang.ClassCastException - If is not an instance of .

clone

public java.lang.Object clone()
Returns a clone of this statistics.

Specified by:
clone in interface org.opengis.util.Cloneable
Overrides:
clone in class Statistics

equals

public boolean equals(java.lang.Object obj)
Test this statistics with the specified object for equality.

Overrides:
equals in class Statistics

hashCode

public int hashCode()
Returns a hash code value for this statistics.

Overrides:
hashCode in class Statistics


Copyright © GeoTools. All Rights Reserved.