com.esri.core.internal.value
Class ClassBreaksDefinition

java.lang.Object
  extended by com.esri.core.internal.value.ClassificationDef
      extended by com.esri.core.internal.value.ClassBreaksDefinition

public class ClassBreaksDefinition
extends ClassificationDef

This class defines a class breaks renderer when requesting a renderer from a dynamic map service's generateDataClasses REST endpoint.

A class breaks renderer is defined by a classification method and field and number of class breaks desired. Optionally a normalization type can also be set. The user can also specify an optional base symbol and color ramp to be used by the renderer.

If the StdDeviation classification method is used, a standard deviation interval can be set. If the ByField normalization type is used, the normalization field should also be specified.


Nested Class Summary
static class ClassBreaksDefinition.ClassificationMethod
          The ClassificationMethod to be used by the server when determining class breaks.
 
Field Summary
static float HALF
          Standard deviation interval of 0.5
static float ONE
          Standard deviation interval of 1.0
static float QUARTER
          Standard deviation interval of 0.25
static float THIRD
          Standard deviation interval of 0.33
 
Fields inherited from class com.esri.core.internal.value.ClassificationDef
_type
 
Constructor Summary
  ClassBreaksDefinition(org.codehaus.jackson.JsonNode node)
          Instantiates a new class breaks definition from the given JSON node.
protected ClassBreaksDefinition(String classificationField, ClassBreaksDefinition.ClassificationMethod classificationMethod, int breakCount, float stdDeviationInterval, NormalizationType normalizationType, String normalizationField)
          Instantiates a new class breaks definition.
 
Method Summary
static ClassBreaksDefinition createByClassificationMethod(String classificationField, ClassBreaksDefinition.ClassificationMethod classificationMethod, int breakCount)
          Create a new ClassBreaksDefinition instance with the given classification field and method and desired number of breaks.
static ClassBreaksDefinition createByNormalizationMethod(String classificationField, ClassBreaksDefinition.ClassificationMethod classificationMethod, int breakCount, NormalizationType normalizationType)
          Create a new ClassBreaksDefinition instance with the given classification field and method, desired number of breaks and normalization method.
static ClassBreaksDefinition createByStdDeviation(String classificationField, float stdDeviationInterval)
          Create a new ClassBreaksDefinition instance with classification by standard deviation with the given classification field, desired number of breaks and standard deviation interval.
static ClassBreaksDefinition createWithNormalizeByField(String classificationField, ClassBreaksDefinition.ClassificationMethod classificationMethod, int breakCount, String normalizationField)
          Create a new ClassBreaksDefinition instance with the given classification field and method, desired number of breaks and normalizing by a given field.
 int getBreakCount()
          Gets the break count.
 String getClassificationField()
          Gets the classification field.
 ClassBreaksDefinition.ClassificationMethod getClassificationMethod()
          Gets the classification method.
 String getNormalizationField()
          Gets the normalization field.
 NormalizationType getNormalizationType()
          Gets the normalization type.
 float getStdDevInterval()
          Gets the standard deviation interval.
 void setBreakCount(int breakCount)
          Sets the break count.
 void setClassificationField(String classificationField)
          Sets the classification field.
 void setClassificationMethod(ClassBreaksDefinition.ClassificationMethod classificationMethod)
          Sets the classification method.
 void setNormalizationField(String normalizationField)
          Sets the normalization field.
 void setNormalizationType(NormalizationType normalizationType)
          Sets the normalization type.
 void setStdDevInterval(float stdDevInterval)
          Sets the standard deviation interval.
protected  void toJson(org.codehaus.jackson.JsonGenerator node)
          This method is used by ClassificationDef.toJson() to turn this instance into a JSON string.
 
Methods inherited from class com.esri.core.internal.value.ClassificationDef
getBaseSymbol, getColorRamp, setBaseSymbol, setColorRamp, toJson
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ONE

public static final float ONE
Standard deviation interval of 1.0

See Also:
Constant Field Values

HALF

public static final float HALF
Standard deviation interval of 0.5

See Also:
Constant Field Values

THIRD

public static final float THIRD
Standard deviation interval of 0.33

See Also:
Constant Field Values

QUARTER

public static final float QUARTER
Standard deviation interval of 0.25

See Also:
Constant Field Values
Constructor Detail

ClassBreaksDefinition

protected ClassBreaksDefinition(String classificationField,
                                ClassBreaksDefinition.ClassificationMethod classificationMethod,
                                int breakCount,
                                float stdDeviationInterval,
                                NormalizationType normalizationType,
                                String normalizationField)
Instantiates a new class breaks definition.

Parameters:
classificationField - the classification field
classificationMethod - the classification method
breakCount - the break count
stdDeviationInterval - the standard deviation interval
normalizationType - the normalization type
normalizationField - the normalization field

ClassBreaksDefinition

public ClassBreaksDefinition(org.codehaus.jackson.JsonNode node)
Instantiates a new class breaks definition from the given JSON node.

Parameters:
node - the node defining a class breaks definition
Method Detail

createByClassificationMethod

public static ClassBreaksDefinition createByClassificationMethod(String classificationField,
                                                                 ClassBreaksDefinition.ClassificationMethod classificationMethod,
                                                                 int breakCount)
Create a new ClassBreaksDefinition instance with the given classification field and method and desired number of breaks. If you wish to classify by standard deviation, you will either need to set the standard deviation interval with the setStdDevInterval(float) method or use #createByStdDeviation(String, int, float).

Parameters:
classificationField - the classification field
classificationMethod - the classification method
breakCount - the break count
Returns:
the class breaks definition

createByStdDeviation

public static ClassBreaksDefinition createByStdDeviation(String classificationField,
                                                         float stdDeviationInterval)
Create a new ClassBreaksDefinition instance with classification by standard deviation with the given classification field, desired number of breaks and standard deviation interval.

Parameters:
classificationField - the classification field
breakCount - the break count
stdDeviationInterval - the std deviation interval
Returns:
the class breaks definition

createByNormalizationMethod

public static ClassBreaksDefinition createByNormalizationMethod(String classificationField,
                                                                ClassBreaksDefinition.ClassificationMethod classificationMethod,
                                                                int breakCount,
                                                                NormalizationType normalizationType)
Create a new ClassBreaksDefinition instance with the given classification field and method, desired number of breaks and normalization method. If you wish to normalize by a field value, either set the field name with the setNormalizationField(String) method or use createWithNormalizeByField(String, ClassificationMethod, int, String)

Parameters:
classificationField - the classification field
classificationMethod - the classification method
breakCount - the break count
normalizationType - the normalization type
Returns:
the class breaks definition

createWithNormalizeByField

public static ClassBreaksDefinition createWithNormalizeByField(String classificationField,
                                                               ClassBreaksDefinition.ClassificationMethod classificationMethod,
                                                               int breakCount,
                                                               String normalizationField)
Create a new ClassBreaksDefinition instance with the given classification field and method, desired number of breaks and normalizing by a given field.

Parameters:
classificationField - the classification field
classificationMethod - the classification method
breakCount - the break count
normalizationField - the normalization field
Returns:
the class breaks definition

setClassificationField

public void setClassificationField(String classificationField)
Sets the classification field.

Parameters:
classificationField - the new classification field

getClassificationField

public String getClassificationField()
Gets the classification field.

Returns:
the classification field

setClassificationMethod

public void setClassificationMethod(ClassBreaksDefinition.ClassificationMethod classificationMethod)
Sets the classification method.

Parameters:
classificationMethod - the new classification method
See Also:
ClassBreaksDefinition.ClassificationMethod

getClassificationMethod

public ClassBreaksDefinition.ClassificationMethod getClassificationMethod()
Gets the classification method.

Returns:
the classification method

setBreakCount

public void setBreakCount(int breakCount)
Sets the break count.

Parameters:
breakCount - the new break count

getBreakCount

public int getBreakCount()
Gets the break count.

Returns:
the break count

setStdDevInterval

public void setStdDevInterval(float stdDevInterval)
Sets the standard deviation interval.

Parameters:
stdDevInterval - the new standard deviation interval

getStdDevInterval

public float getStdDevInterval()
Gets the standard deviation interval.

Returns:
the standard deviation interval

setNormalizationField

public void setNormalizationField(String normalizationField)
Sets the normalization field.

Parameters:
normalizationField - the new normalization field

getNormalizationField

public String getNormalizationField()
Gets the normalization field.

Returns:
the normalization field

setNormalizationType

public void setNormalizationType(NormalizationType normalizationType)
Sets the normalization type.

Parameters:
normalizationType - the new normalization type
See Also:
NormalizationType

getNormalizationType

public NormalizationType getNormalizationType()
Gets the normalization type.

Returns:
the normalization type

toJson

protected void toJson(org.codehaus.jackson.JsonGenerator node)
               throws IOException,
                      org.codehaus.jackson.JsonGenerationException,
                      Exception
Description copied from class: ClassificationDef
This method is used by ClassificationDef.toJson() to turn this instance into a JSON string.

This method should be overridden in subclasses to add their class data to the given JSON node. Note that this base class method should be called by the override.

Overrides:
toJson in class ClassificationDef
Parameters:
node - the node to add fields to
Throws:
IOException - Signals that an I/O exception has occurred.
org.codehaus.jackson.JsonGenerationException - the json generation exception
Exception - the exception


Copyright © 2012. All Rights Reserved.