Class ClassBreaksRenderer.ClassBreak

java.lang.Object
com.esri.arcgisruntime.symbology.ClassBreaksRenderer.ClassBreak
All Implemented Interfaces:
JsonSerializable
Enclosing class:
ClassBreaksRenderer

public static final class ClassBreaksRenderer.ClassBreak extends Object implements JsonSerializable
Defines a single class break as used by ClassBreaksRenderer. ClassBreak is used to categorize a group of values that fall within a range defined by getMinValue() and getMaxValue(). A value is determined to be within the range if it is greater than the minimum value but less than or equal to the maximum value. Written as an algebraic equation, it would look like ClassBreak.getMinValue < value <= ClassBreak.getMaxValue.

This class defines the min and max values for the renderer to use, the description, a label for use in a legend, and the symbol that will be displayed. If a renderer is to be used with continuous class breaks, you only need to set the maximum value of each break. The minimum value will be defined by the maximum of the preceding class break. The first class break's minimum will be defined by ClassBreaksRenderer.setMinValue(double).

For example, assume you wanted to create a set of ClassBreak categories based on the following integers (0, 0, 1, 1, 2, 4, 6, 6, 7, 10). The following table would be helpful in defining the ClassBreak range settings:

ClassBreak Range Settings
categorized group of values count label minValue maxValue
0 2 none -1 0
1-2 3 one to two 0 2
3-5 1 three to five 2 5
6-10 4 six to ten 5 10
Since:
100.0.0
See Also:
  • Constructor Details

    • ClassBreak

      public ClassBreak()
      Creates a new class break object.
      Since:
      100.0.0
    • ClassBreak

      public ClassBreak(String description, String label, double minValue, double maxValue, Symbol symbol)
      Creates a new ClassBreak instance with the specified description, legend label, min and max values and the symbol that will be displayed.
      Parameters:
      description - A description of the class break. For example: "Cities with a population under 100,000"
      label - A label for the class break. For example: "0 - 100000"
      minValue - the min value for the range that defines this class break. minValue is exclusive (>).
      maxValue - the max value for the range that defines this class break. maxValue is inclusive (<=).
      symbol - a symbol used to represent elements in the class break.
      Throws:
      NullPointerException - if symbol is null.
      Since:
      100.0.0
    • ClassBreak

      public ClassBreak(String description, String label, double minValue, double maxValue, Symbol symbol, Iterable<Symbol> alternateSymbols)
      Creates a new class break object with alternate symbols.

      A class break can have alternate symbols to the primary symbol. Alternate symbols allow you to tailor the visualization of class break at different scales by selecting different symbol for different scales. Alternate symbols are supported only when class break's primary symbol and other symbols in alternate symbol list are of type MultilayerSymbol and have SymbolReferenceProperties defining valid min max scales at which the symbol becomes visible. Renderer will pick only one symbol at a given map scale. If primary symbol's scale range falls within the map's scale, primary symbol is used. If not, then symbols in alternate symbols list are iterated through and first symbol matching the current map scale is picked for rendering. A symbol becomes visible if the map scale is less than or equal to symbol's minimum scale and greater than symbol's maximum scale. For more information about scale-based symbol classes and alternate symbols, see Use scale-based symbol classes.

      Parameters:
      description - a description of the class break. "Cities with a population under 100,000", for example.
      label - a label for the class break. "0 - 100000", for example.
      minValue - the minimum value of the range that defines the break
      maxValue - the maximum value of the range that defines the break
      symbol - a symbol used to represent elements in the class break, may be null
      alternateSymbols - the alternate symbols for the class break. Only MultilayerSymbol are supported as alternates. This param may be null.
      Since:
      100.13.0
  • Method Details

    • fromJson

      public static ClassBreaksRenderer.ClassBreak fromJson(String json)
      Creates a ClassBreak instance from a JSON string.
      Parameters:
      json - a JSON string that represents a ClassBreak
      Returns:
      a ClassBreak instance
      Throws:
      IllegalArgumentException - if json is null or empty
      Since:
      100.0.0
    • getAlternateSymbols

      public List<Symbol> getAlternateSymbols()
      Gets the alternate symbols for the class break's primary symbol. Symbols in this list should be of type MultilayerSymbol and must have SymbolReferenceProperties set with valid minimum and maximum scale at which symbol becomes visible. Renderer will pick only one symbol at a given map scale. If primary symbol's scale range falls within the map's scale, primary symbol is used. If not, then symbols in alternate symbols list are iterated through and first symbol matching the current map scale is picked for rendering. A symbol becomes visible if the map scale is less than or equal to symbol's minimum scale and greater than symbol's maximum scale.
      Returns:
      the alternate symbols for the class break's primary symbol.
      Since:
      100.13.0
    • toJson

      public String toJson()
      Description copied from interface: JsonSerializable
      Serializes this object to a JSON string. Note that unknown JSON is omitted from the serialized string.
      Specified by:
      toJson in interface JsonSerializable
      Returns:
      a JSON string
    • getUnknownJson

      public Map<String,Object> getUnknownJson()
      Description copied from interface: JsonSerializable
      Gets unknown data from the source JSON.

      Unknown JSON is a Map of values not defined in the ArcGIS specification used to create this object but found in the source JSON. If the object is written back to JSON, any unknown JSON data is not persisted. The ArcGIS specification may be for a web map, web scene, REST API, and so on.

      Specified by:
      getUnknownJson in interface JsonSerializable
      Returns:
      an unmodifiable Map containing unknown data from the source JSON
    • getUnsupportedJson

      public Map<String,Object> getUnsupportedJson()
      Description copied from interface: JsonSerializable
      Gets unsupported data from the source JSON.

      Unsupported JSON is a Map of values defined in the ArcGIS specification used to create this object but not currently used in this API. If the object is written back to JSON, any unsupported JSON data is persisted. The ArcGIS specification may be from a web map, web scene, REST API, and so on.

      Specified by:
      getUnsupportedJson in interface JsonSerializable
      Returns:
      an unmodifiable Map containing unsupported data from the source JSON
    • getMinValue

      public double getMinValue()
      Gets the class min value for the range that defines this class break.
      Returns:
      the class min value
      Since:
      100.0.0
      See Also:
    • setMinValue

      public void setMinValue(double minValue)
      Sets the class min value for the range that defines this class break. The min value is exclusive (>).
      Parameters:
      minValue - the new class min value
      Since:
      100.0.0
      See Also:
    • getMaxValue

      public double getMaxValue()
      Gets the class max value for the range that defines this class break.
      Returns:
      the class max value
      Since:
      100.0.0
      See Also:
    • setMaxValue

      public void setMaxValue(double maxValue)
      Sets the class max value for the range that defines this class break. The max value is inclusive (<=).
      Parameters:
      maxValue - the new class max value
      Since:
      100.0.0
      See Also:
    • getDescription

      public String getDescription()
      Gets the description of the class break.
      Returns:
      the description
      Since:
      100.0.0
      See Also:
    • setDescription

      public void setDescription(String description)
      Sets the description of the class break. For example: "Cities with population under 100,000."
      Parameters:
      description - the description
      Since:
      100.0.0
      See Also:
    • getLabel

      public String getLabel()
      Gets a label for the class break. Suitable for showing in a legend.
      Returns:
      the label
      Since:
      100.0.0
      See Also:
    • setLabel

      public void setLabel(String label)
      Sets the legend label for the class break. For example: "0 - 100000".
      Parameters:
      label - the new label
      Since:
      100.0.0
      See Also:
    • getSymbol

      public Symbol getSymbol()
      Gets the symbol used to represent elements in this ClassBreak in a GeoView.
      Returns:
      the symbol
      Since:
      100.0.0
    • setSymbol

      public void setSymbol(Symbol symbol)
      Sets the symbol used to represent elements in this ClassBreak in a GeoView. If symbol is null, the features in the ClassBreak will not be drawn and are thus invisible.
      Parameters:
      symbol - the symbol
      Since:
      100.0.0