Package org.geotools.metadata.math
Class Statistics.Delta
- Object
-
- Statistics
-
- Delta
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Cloneable
- Enclosing class:
- Statistics
public static class Statistics.Delta extends Statistics
Holds 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 thanStatistics
and additionnaly computes statistics for s1-s0, s2-s1, s3-s2..., which are stored in adelta
statistics object.- Author:
- Martin Desruisseaux (IRD)
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class Statistics
Statistics.Delta
-
-
Constructor Summary
Constructors Constructor Description Delta()
Constructs an initially empty set of statistics.Delta(Statistics delta)
Constructs an initially empty set of statistics using the specified object fordelta
statistics.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(double sample)
Updates statistics for the specified sample.void
add(long sample)
Updates statistics for the specified sample.void
add(Statistics stats)
Update statistics with all samples from the specifiedstats
.Statistics.Delta
clone()
Returns a clone of this statistics.boolean
equals(Object obj)
Tests 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()
Resets the statistics to their initialNaN
values.
-
-
-
Constructor Detail
-
Delta
public Delta()
Constructs an initially empty set of statistics. All statistical values are initialized toDouble.NaN
.
-
Delta
public Delta(Statistics delta)
Constructs an initially empty set of statistics using the specified object fordelta
statistics. This method allows chaining different kind of statistics objects. For example, one could write:new Statistics.Delta(new Statistics.Delta());
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()
Resets the statistics to their initialNaN
values. This method reset this object state as if it was just created.- Overrides:
reset
in classStatistics
-
add
public void add(double sample)
Updates statistics for the specified sample. Thedelta
statistics are updated withsample - samplelast
value, wheresamplelast
is the last value given to the previous call of anadd(...)
method.- Overrides:
add
in classStatistics
- Parameters:
sample
- The sample value.NaN
values are ignored.- See Also:
Statistics.add(long)
,Statistics.add(Statistics)
-
add
public void add(long sample)
Updates statistics for the specified sample. Thedelta
statistics are updated withsample - samplelast
value, wheresamplelast
is the last value given to the previous call of anadd(...)
method.- Overrides:
add
in classStatistics
- Parameters:
sample
- The sample value.- See Also:
Statistics.add(double)
,Statistics.add(Statistics)
-
add
public void add(Statistics stats) throws ClassCastException
Update statistics with all samples from the specifiedstats
. Invoking this method is equivalent (except for rounding errors) to invokingadd
for all samples that were added tostats
. Thestats
argument must be an instance ofStatistics.Delta
.- Overrides:
add
in classStatistics
- Parameters:
stats
- The statistics to be added tothis
, ornull
if none.- Throws:
ClassCastException
- Ifstats
is not an instance ofStatistics.Delta
.
-
clone
public Statistics.Delta clone()
Returns a clone of this statistics.- Specified by:
clone
in interfaceCloneable
- Overrides:
clone
in classStatistics
- Returns:
- A copy of this object.
- See Also:
Object.clone()
-
equals
public boolean equals(Object obj)
Tests this statistics with the specified object for equality.- Overrides:
equals
in classStatistics
-
hashCode
public int hashCode()
Returns a hash code value for this statistics.- Overrides:
hashCode
in classStatistics
-
-