com.esri.arcgis.system
Class DefinedInterval

java.lang.Object
  extended by com.esri.arcgis.system.DefinedInterval
All Implemented Interfaces:
com.esri.arcgis.interop.RemoteObjRef, IClassify, IClassifyGEN, IClassifyMinMax, IClassifyMinMax2, IIntervalRange, IIntervalRange2, Serializable

public class DefinedInterval
extends Object
implements com.esri.arcgis.interop.RemoteObjRef, IClassifyGEN, IClassify, IClassifyMinMax, IClassifyMinMax2, IIntervalRange, IIntervalRange2

Defines a defined interval classification method.

Description

The DefinedInterval coclass represents a defined interval classification; this divides a set of attribute values into classes that are divided by precise numeric increments, such as 10, 100, or 500.

This classification works well for values that people are accustomed to seeing in rounded numbers, such as age distribution, income level, or elevation ranges. The disadvantage is that some of the classes, particularly the first and last, may contain a disproportionate number of values.

Set up the data values with IClassify::SetHistogramData then use the IIntervalRange interface to retrieve a default interval or to set a different interval. This would typically be the maximum data value divided by five, so by default you will have five classes. To override this, set a different interval into the IntervalRange property. When you are calling IClassify::Classify, the number of classes returned depends on the maximum data value divided by the interval.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

See Also:
Serialized Form

Constructor Summary
DefinedInterval()
          Constructs a DefinedInterval using ArcGIS Engine.
DefinedInterval(Object obj)
          Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
DefinedInterval theDefinedInterval = (DefinedInterval) obj;
 
Method Summary
 void classify(int[] numClasses)
          Classifies data into the specified number of classes.
 void classify(Object doubleArrayValues, Object longArrayFrequencies, int[] numClasses)
          Deprecated. This method uses C style arrays which are not supported in the ArcGIS API for Java. It is replaced by SystemHelper.classify(com.esri.arcgis.system.IClassifyGEN, double[], int[], int[]).
 void classifyMinMax(double min, double max, int[] numClasses)
          Classifies a data range defined by a minimum and maximum value into the specified number of classes.
 boolean equals(Object o)
          Compare this object with another
 Object getClassBreaks()
          The array of class breaks (double).
 IUID getClassID()
          The CLSID for the classification object.
static String getClsid()
          getClsid.
 double getDefault()
          The Default Range for the data.
 double getDefault(Object values, Object frequencies)
          The Default Range for the data.
 String getMethodName()
          The name of the classification method (based on choice of classification object).
 int hashCode()
          the hashcode for this object
 void setHistogramData(Object doubleArrayValues, Object longArrayFrequencies)
          Adds data in form of a histogram (array of values (doubles) and a paired array of frequencies (longs)) to the classification.
 void setIntervalRange(double rhs1)
          The Interval Range.
 void setMaximum(double rhs1)
          The maximum value.
 void setMinimum(double rhs1)
          The minimum value.
 
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

DefinedInterval

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

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

DefinedInterval

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

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

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

classify

public void classify(Object doubleArrayValues,
                     Object longArrayFrequencies,
                     int[] numClasses)
              throws IOException,
                     AutomationException
Deprecated. This method uses C style arrays which are not supported in the ArcGIS API for Java. It is replaced by SystemHelper.classify(com.esri.arcgis.system.IClassifyGEN, double[], int[], int[]).

Classifies histogram data (array of values (doubles) and a paired array of frequencies (longs)) into the specified number of classes.

Description

Classify generates the ClassBreaks based upon the numeric data passed and the number of classes specified.

Pass two safe arrays to the Classify method that must have the same number of elements and an index of zero for their first element. The first array (doubeArrayValues) is the numeric data values, defined as an array of double. This array must be sorted in increasing value order. The second array (longArrayFrequencies) represents the frequency of occurrence of the values, that is, an integer count of the number of times a value occurs.

For example, if the two arrays were called DataValues and DataFrequency, the lowest value would be stored in DataValue(0), and the number of times this value occurred would be stored in DataFrequency(0).

You could populate these arrays in code yourself, but if the data is available through the attribute field of a table, you can utilize the TableHistogram object to gather the data values and frequencies for you.

You must supply the number of desired classes as a variable defined as a Long. Some classification algorithms will return a different number of class breaks to what you specified. The number of classes will be written back to the variable you supplied, so it is always best to recheck the number of class breaks after calling Classify.

Product Availability

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

Specified by:
classify in interface IClassifyGEN
Parameters:
doubleArrayValues - A Variant (in)
longArrayFrequencies - A Variant (in)
numClasses - The numClasses (in/out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getClassBreaks

public Object getClassBreaks()
                      throws IOException,
                             AutomationException
The array of class breaks (double). ClassBreaks(0) is the minimum value in the dataset, and subsequent breaks represent the upper limit of each class.

Description

ClassBreaks returns an array of class breaks. The number of breaks may be different than what was specified in the Classify method, so it is essential that you check this before setting the BreakCount on IClassBreaksRenderer . The reason this may be different has to do with how a particular classification method handles skewness in the data being classified.
The first ClassBreak returned is the minimum value of the data being classified. The rest of the breaks are the upper bounds for each class. The last break represents the upper bound of the highest class.
To properly assign ClassBreaks to an IClassBreaksRenderer:
1. Set IClassBreaksRenderer.MinimumBreak = IClassify.ClassBreaks(0)
2. Set IClassBreaksRenderer.Breaks(0) = IClassify.ClassBreaks(1)
3. Set IClassBreaksRenderer.Breaks(1) = IClassify.ClassBreaks(2)
etc.

Remarks

Note that the Breaks property array on the ClassBreaksRenderer has one less entry than the array returned from Classify. The first break value in the array returned from Classify is put into the ClassBreakRenderers’ MinimumBreak property. Next, copy the break values into the ClassBreaksRenderer object. You can set up the symbol property of the classes at the same time.

Product Availability

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

Specified by:
getClassBreaks in interface IClassify
Specified by:
getClassBreaks in interface IClassifyGEN
Returns:
A Variant
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getMethodName

public String getMethodName()
                     throws IOException,
                            AutomationException
The name of the classification method (based on choice of classification object).

Description

MethodName returns the classification method name (as it appears in the classification dialog). Use to determine the CoClass currently implementing IClassifyGEN.

Product Availability

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

Specified by:
getMethodName in interface IClassify
Specified by:
getMethodName in interface IClassifyGEN
Returns:
The txt
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
StandardDeviation, EqualInterval, NaturalBreaks, ClassBreaksRenderer, DefinedInterval, Quantile

getClassID

public IUID getClassID()
                throws IOException,
                       AutomationException
The CLSID for the classification object.

Description

Returns the GUID of the classification object.

Product Availability

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

Specified by:
getClassID in interface IClassify
Specified by:
getClassID in interface IClassifyGEN
Returns:
A reference to a com.esri.arcgis.system.IUID
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setHistogramData

public void setHistogramData(Object doubleArrayValues,
                             Object longArrayFrequencies)
                      throws IOException,
                             AutomationException
Adds data in form of a histogram (array of values (doubles) and a paired array of frequencies (longs)) to the classification.

Description

To pass numeric data into the Classify object, the SetHistogramData method is used. This takes two safe arrays that must have the same number of elements and an index of zero for their first element. The first array is the numeric data values, defined as an array of double. This array must be sorted in increasing value order. The second array represents the frequency of occurrence of the values, that is, an integer count of the number of times a value occurs.

For example, if the two arrays were called DataValues and DataFrequency, the lowest value would be stored in DataValue(0), and the number of times this value occurred would be stored in DataFrequency(0).

You could populate these arrays in code yourself, but if the data is available through the attribute field of a table, you can utilize the TableHistogram object to gather the data values and frequencies for you.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
setHistogramData in interface IClassify
Parameters:
doubleArrayValues - A Variant (in)
longArrayFrequencies - A Variant (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

classify

public void classify(int[] numClasses)
              throws IOException,
                     AutomationException
Classifies data into the specified number of classes.

Description

Classify generates the ClassBreaks given the number of classes specified. Use Classify only after you have added data to the classification using SetHistogramData.

Remarks

Having obtained the data values and frequencies using the SetHistogramData method, the next step is to compute some class breaks. Do this by calling the Classify method and specifying the number of classes you would like. You must supply the number of desired classes as a variable defined as a Long. Some classification algorithms will return a different number of class breaks to what you specified. The number of classes will be written back to the variable you supplied, so it is always best to recheck the number of class breaks after calling Classify.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
classify in interface IClassify
Parameters:
numClasses - The numClasses (in/out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setMinimum

public void setMinimum(double rhs1)
                throws IOException,
                       AutomationException
The minimum value.

Description

Set the Minimum value in order to generate class breaks with the IClassify.Classify method. You will also need to set the Maximum value before generating the class breaks.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

setMaximum

public void setMaximum(double rhs1)
                throws IOException,
                       AutomationException
The maximum value.

Description

Set the Maximum value in order to generate class breaks with the IClassify.Classify method. You also will need to set the Minimum value before generating the class breaks.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

classifyMinMax

public void classifyMinMax(double min,
                           double max,
                           int[] numClasses)
                    throws IOException,
                           AutomationException
Classifies a data range defined by a minimum and maximum value into the specified number of classes.

Description

Use the ClassifyMinMax method to generate class breaks based upon the minimum and maximum values specified and the number of classes specified.

Use this method as an alternative to setting the IClassifyMinMax.Minimum and IClassifyMinMax.Maximum properties and then calling IClassify.Classify method.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
classifyMinMax in interface IClassifyMinMax2
Parameters:
min - The min (in)
max - The max (in)
numClasses - The numClasses (in/out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setIntervalRange

public void setIntervalRange(double rhs1)
                      throws IOException,
                             AutomationException
The Interval Range. Call before Classify.

Description

IntervalRange is the range expressed as the data interval. When using with DefinedInterval, set this after you set issue the IClassify.SetHistogramData method and before you use the IClassify.Classify method.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
setIntervalRange in interface IIntervalRange
Specified by:
setIntervalRange in interface IIntervalRange2
Parameters:
rhs1 - The rhs1 (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
IDeviationInterval, IClassify, IClassify.classify(int[]), IClassify.setHistogramData(java.lang.Object, java.lang.Object)

getDefault

public double getDefault()
                  throws IOException,
                         AutomationException
The Default Range for the data. Data must be added before calling.

Description

Default is the default interval for a given IClassify object that implements the DefinedInterval CoClass. Use only after using the SetHistogramData method on IClassify.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
getDefault in interface IIntervalRange
Returns:
The range
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
IDeviationInterval, IClassify, IClassify.classify(int[]), IClassify.setHistogramData(java.lang.Object, java.lang.Object)

getDefault

public double getDefault(Object values,
                         Object frequencies)
                  throws IOException,
                         AutomationException
The Default Range for the data.

Product Availability

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

Specified by:
getDefault in interface IIntervalRange2
Parameters:
values - A Variant (in)
frequencies - A Variant (in)
Returns:
The range
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.