Class 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. Used to categorize a group of values that fall within a range of values. When written as an algebraic equation, it would look like minValue < value <= maxValue.

    It 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).

    Used to categorize a group of values that fall between a min value (exclusive) and a max value (inclusive). 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:
    ClassBreaksRenderer
    • Constructor Detail

      • ClassBreak

        public ClassBreak()
        Creates a new empty ClassBreak instance.
        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
    • Method Detail

      • 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
      • 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
        If this object was created from JSON, this method gets unknown data from the source JSON. Unknown JSON is a Map of values that were in the source JSON but are not known by the Runtime and therefore not exposed in the API.
        Specified by:
        getUnknownJson in interface JsonSerializable
        Returns:
        an unmodifiable Map containing unknown JSON data. The keys are Strings containing names. The types of the values depend on the types of tokens within the JSON as follows:
        • a Map<String, Object> represents an object in the JSON
        • a List<Object> represents an array in the JSON
        • a String represents a string in the JSON
        • a Double represents a number in the JSON
        • a Boolean represents true or false in the JSON
        • null represents null in the JSON
      • getUnsupportedJson

        public Map<String,​Object> getUnsupportedJson()
        Description copied from interface: JsonSerializable
        If this object was created from JSON, this method gets unsupported data from the source JSON. Unsupported JSON is a Map of values that are supported by webmaps and known to the version of the webmap specification the API supports (see system requirements), but are not explicitly exposed through the Runtime API.
        Specified by:
        getUnsupportedJson in interface JsonSerializable
        Returns:
        an unmodifiable Map containing unsupported JSON data. The keys are Strings containing names. The types of the values depend on the types of tokens within the JSON as follows:
        • a Map<String, Object> represents an object in the JSON
        • a List<Object> represents an array in the JSON
        • a String represents a string in the JSON
        • a Double represents a number in the JSON
        • a Boolean represents true or false in the JSON
        • null represents null in the 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(double)
      • 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:
        getMinValue()
      • 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(double)
      • 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:
        getMaxValue()
      • getDescription

        public String getDescription()
        Gets the description of the class break.
        Returns:
        the description
        Since:
        100.0.0
        See Also:
        setDescription(String)
      • 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:
        getDescription()
      • 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(String)
      • 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:
        getLabel()
      • 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