public class

ClassBreaksRenderer

extends Object
implements Renderer<V>
java.lang.Object
   ↳ com.esri.core.renderer.ClassBreaksRenderer

Class Overview

A class breaks renderer symbolizes each graphic based on the value of some numeric attribute. Graphics with similar values for the attribute get the same symbol. The "breaks" define the values at which the symbology changes.Each break has a value range determined by its maximum value and implicit minimum value.

For example, suppose you have a "buildings" layer with an attribute that defines the building age. You want to symbolize buildings constructed since the year 2000 in green, buildings constructed between 1980 and 2000 in yellow, and buildings built before 1980 with red. This would be a good scenario for a class breaks renderer.

Summary

Constants
String TYPE The Constant TYPE.
Public Constructors
ClassBreaksRenderer()
The Constructor.
ClassBreaksRenderer(JsonNode node)
Instantiates ClassBreaksRenderer from a Json node object.
Public Methods
boolean addClassBreak(ClassBreak classbreak)
Adds a class break.
TreeMap<DoubleClassBreak> getClassBreakInfos()
Returns a TreeMap object in which class break's maximum value maps to class break.
Symbol getDefaultSymbol()
Gets the default symbol of the ClassBreaksRenderer.
String getField()
Gets the attribute field used by renderer to match values.
double getMinValue()
Gets the minimum value.
Symbol getSymbol(Graphic graphic)
Returns the symbol of the class break the graphic provided belongs to.
boolean removeClassBreak(ClassBreak classbreak)
Removes a class break.
void setClassBreakInfos(TreeMap<DoubleClassBreak> classBreakInfos)
Sets class break information map.
void setDefaultSymbol(Symbol defaultSymbol)
Sets the default symbol of the ClassBreaksRenderer.
void setField(String field)
Sets the attribute field used by renderer to match values.
void setMinValue(double minValue)
Sets minimum value.
String toJson()
Converts into a JSON string.
List<FeatureTemplate> toTemplates(Geometry.Type type)
Creates templates out of the renderer.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.esri.core.renderer.Renderer

Constants

public static final String TYPE

The Constant TYPE.

Constant Value: "classBreaks"

Public Constructors

public ClassBreaksRenderer ()

The Constructor.

public ClassBreaksRenderer (JsonNode node)

Instantiates ClassBreaksRenderer from a Json node object.

Parameters
node the node
Throws
Exception the exception

Public Methods

public boolean addClassBreak (ClassBreak classbreak)

Adds a class break.

Parameters
classbreak a class break.
Returns
  • true, if adds the class break

public TreeMap<DoubleClassBreak> getClassBreakInfos ()

Returns a TreeMap object in which class break's maximum value maps to class break.

Returns
  • the class breaks information map.

public Symbol getDefaultSymbol ()

Gets the default symbol of the ClassBreaksRenderer. It will be used on the values which in the ranges.

Returns
  • Returns the defaultSymbol.

public String getField ()

Gets the attribute field used by renderer to match values.

Returns
  • the field.

public double getMinValue ()

Gets the minimum value.

Returns
  • the minimum value.

public Symbol getSymbol (Graphic graphic)

Returns the symbol of the class break the graphic provided belongs to.

Parameters
graphic the graphic to be symbolized
Returns
  • the symbol

public boolean removeClassBreak (ClassBreak classbreak)

Removes a class break.

Parameters
classbreak a class break.
Returns
  • true if the class break is removed successfully.

public void setClassBreakInfos (TreeMap<DoubleClassBreak> classBreakInfos)

Sets class break information map.

Parameters
classBreakInfos a TreeMap object in which class break's maximum value maps to class break.

public void setDefaultSymbol (Symbol defaultSymbol)

Sets the default symbol of the ClassBreaksRenderer. It is null by default.

Parameters
defaultSymbol The defaultSymbol to set.

public void setField (String field)

Sets the attribute field used by renderer to match values.

Parameters
field the field to set

public void setMinValue (double minValue)

Sets minimum value.

Parameters
minValue the minimum value to set

public String toJson ()

Converts into a JSON string.

Returns
  • a JSON string.
Throws
Exception the exception

public List<FeatureTemplate> toTemplates (Geometry.Type type)

Creates templates out of the renderer.

Parameters
type the geometry type. The templates are defined on feature layers, the geometry type is defined on feature layers.
Returns
  • the list< feature template>