com.esri.arcgis.system
Class BaseStatistics

java.lang.Object
  extended by com.esri.arcgis.system.BaseStatistics
All Implemented Interfaces:
com.esri.arcgis.interop.RemoteObjRef, IFrequencyStatistics, IGenerateStatistics, IStatisticsResults, Serializable

public class BaseStatistics
extends Object
implements com.esri.arcgis.interop.RemoteObjRef, IGenerateStatistics, IStatisticsResults, IFrequencyStatistics

Base statistics class for generating and reporting statistics.

Description

The BaseStatistics class provides facilities to store and retrieve statistics for a set of numeric values.

BaseStatistics is normally used with the DataStatistics object (defined in esriGeodatabase) in order to return statistics on tabular data. However, a BaseStatistics object can also be cocreated directly to generate statistics for any set of data values.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

See Also:
DataStatistics, Serialized Form

Constructor Summary
BaseStatistics()
          Constructs a BaseStatistics using ArcGIS Engine.
BaseStatistics(Object obj)
          Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
BaseStatistics theBaseStatistics = (BaseStatistics) obj;
 
Method Summary
 void addValue(double value)
          Adds a data value to the collection of values used to derive the statistics.
 void computeAutoFrequencyIntervals()
          Computes a suitable frequency interval count for the number of values.
 boolean equals(Object o)
          Compare this object with another
 void finalCompute()
          May be called after all values have been added to establish frequeny table (the function is not required any more).
static String getClsid()
          getClsid.
 int getCount()
          The count of the values.
 int getFrequencyClassCount(int intervalIndex)
          The frequency class count at a given interval index.
 int getFrequencyIntervalCount()
          The frequency interval count.
 double getFrequencyIntervalSize()
          The size (range) of each frequency interval.
 double getMaximum()
          The maximum value.
 double getMean()
          The arithmetic mean.
 double getMinimum()
          The minimum value.
 double getStandardDeviation()
          The standard deviation, based on sample flag.
 double getSum()
          The sum of the values.
 int hashCode()
          the hashcode for this object
 void reset(boolean simpleStats)
          Clears out the currently gathered statistics.
 void setFrequencyIntervalCount(int numIntervals)
          The frequency interval count.
 void setSample(boolean rhs1)
          Indicates if the statistics represent a sample of the data (used for calculating standard deviation).
 void setSimpleStats(boolean rhs1)
          Indicates if simple statistics are sufficient.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.esri.arcgis.interop.RemoteObjRef
getJintegraDispatch, release
 

Constructor Detail

BaseStatistics

public BaseStatistics()
               throws IOException,
                      UnknownHostException
Constructs a BaseStatistics using ArcGIS Engine.

Throws:
IOException - if there are interop problems
UnknownHostException - if there are interop problems

BaseStatistics

public BaseStatistics(Object obj)
               throws IOException
Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
BaseStatistics theBaseStatistics = (BaseStatistics) obj;

Construct a BaseStatistics using a reference to such an object returned from ArcGIS Engine or Server. This is semantically equivalent to casting obj to BaseStatistics.

Parameters:
obj - an object returned from ArcGIS Engine or Server
Throws:
IOException - if there are interop problems
Method Detail

getClsid

public static String getClsid()
getClsid.


equals

public boolean equals(Object o)
Compare this object with another

Overrides:
equals in class Object

hashCode

public int hashCode()
the hashcode for this object

Overrides:
hashCode in class Object

setSimpleStats

public void setSimpleStats(boolean rhs1)
                    throws IOException,
                           AutomationException
Indicates if simple statistics are sufficient. These are Count, Minimum, Maximum, Sum, Mean, Standard Deviation.

Description

Set SimpleStats to True to obtain statistics using the IStatisticsResults interface, and set SimpleStats to False to obtain statistics using the IFrequencyStatistics interface.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
setSimpleStats in interface IGenerateStatistics
Parameters:
rhs1 - The rhs1 (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setSample

public void setSample(boolean rhs1)
               throws IOException,
                      AutomationException
Indicates if the statistics represent a sample of the data (used for calculating standard deviation).

Description

Set Sample to True before calling IStatisticsResults::StandardDeviation if the BaseStatistics data values are a sample of the real data. Set Sample to False to retrieve the Population Standard Deviation with IStatisticsResults::StandardDeviation.

Remarks

By default IStatisticResults::StandardDeviation returns the Sample Standard Deviation, so there is no need to set the Sample property to True.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
setSample in interface IGenerateStatistics
Parameters:
rhs1 - The rhs1 (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
IStatisticsResults.getStandardDeviation()

reset

public void reset(boolean simpleStats)
           throws IOException,
                  AutomationException
Clears out the currently gathered statistics.

Description

Removes all of the data values from the BaseStatistics.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
reset in interface IGenerateStatistics
Parameters:
simpleStats - The simpleStats (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

addValue

public void addValue(double value)
              throws IOException,
                     AutomationException
Adds a data value to the collection of values used to derive the statistics.

Description

The AddValue method adds the specified data value to the BaseStatistics. After adding all of the data values you can then generate statistics.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
addValue in interface IGenerateStatistics
Parameters:
value - The value (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

finalCompute

public void finalCompute()
                  throws IOException,
                         AutomationException
May be called after all values have been added to establish frequeny table (the function is not required any more).

Description

The FinalCompute method is no longer required when generating statistics.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
finalCompute in interface IGenerateStatistics
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getCount

public int getCount()
             throws IOException,
                    AutomationException
The count of the values.

Description

Returns the Count of data values in the BaseStatistics used to derive the statistics. Use this property when IGenerateStatistics.SimpleStats is set to true.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getCount in interface IStatisticsResults
Returns:
The count
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getMinimum

public double getMinimum()
                  throws IOException,
                         AutomationException
The minimum value.

Description

Returns the Minimum data values in the BaseStatistics. Use this property when IGenerateStatistics.SimpleStats is set to true.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getMinimum in interface IStatisticsResults
Returns:
The min
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getMaximum

public double getMaximum()
                  throws IOException,
                         AutomationException
The maximum value.

Description

Returns the Maximum data values in the BaseStatistics. Use this property when IGenerateStatistics.SimpleStats is set to true.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getMaximum in interface IStatisticsResults
Returns:
The max
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getSum

public double getSum()
              throws IOException,
                     AutomationException
The sum of the values.

Description

Returns the Sum of all the data values in the BaseStatistics. Use this property when IGenerateStatistics.SimpleStats is set to true.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getSum in interface IStatisticsResults
Returns:
The sum
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getMean

public double getMean()
               throws IOException,
                      AutomationException
The arithmetic mean.

Description

Returns the arithmetic Mean of all the data values in the BaseStatistics. Use this property when IGenerateStatistics.SimpleStats is set to true.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getMean in interface IStatisticsResults
Returns:
The mean
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getStandardDeviation

public double getStandardDeviation()
                            throws IOException,
                                   AutomationException
The standard deviation, based on sample flag.

Description

Returns the StandardDeviation of all the data values in the BaseStatistics.

If your data is a sample of the real data, you should indicate so with IGenerateStatistics::Sample before calling StandardDeviation.

Remarks

By default it returns the Sample Standard Deviation.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getStandardDeviation in interface IStatisticsResults
Returns:
The stdDev
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
IGenerateStatistics.setSample(boolean)

getFrequencyIntervalCount

public int getFrequencyIntervalCount()
                              throws IOException,
                                     AutomationException
The frequency interval count.

Description

Either set the number of data intervals using the FrequencyIntervalCount property or use the ComputeAutoFrequencyIntervals method to automatically set the FrequencyIntervalCount based upon the data in the BaseStatistics.

Use the FrequencyIntervalSize to return the size range of each data interval.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getFrequencyIntervalCount in interface IFrequencyStatistics
Returns:
The numIntervals
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setFrequencyIntervalCount

public void setFrequencyIntervalCount(int numIntervals)
                               throws IOException,
                                      AutomationException
The frequency interval count.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
setFrequencyIntervalCount in interface IFrequencyStatistics
Parameters:
numIntervals - The numIntervals (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

computeAutoFrequencyIntervals

public void computeAutoFrequencyIntervals()
                                   throws IOException,
                                          AutomationException
Computes a suitable frequency interval count for the number of values.

Description

The ComputeAutoFrequencyIntervals automatically sets the FrequencyIntervalCount based upon the data in the BaseStatistics.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
computeAutoFrequencyIntervals in interface IFrequencyStatistics
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getFrequencyIntervalSize

public double getFrequencyIntervalSize()
                                throws IOException,
                                       AutomationException
The size (range) of each frequency interval.

Description

Returns the size range of each data interval based upon the FrequencyIntervalCount property and the data values in the BaseStatistics.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getFrequencyIntervalSize in interface IFrequencyStatistics
Returns:
The intervalSize
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getFrequencyClassCount

public int getFrequencyClassCount(int intervalIndex)
                           throws IOException,
                                  AutomationException
The frequency class count at a given interval index.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getFrequencyClassCount in interface IFrequencyStatistics
Parameters:
intervalIndex - The intervalIndex (in)
Returns:
The count
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.