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.

    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). Min values are treated as exclusive (or >) and max values are treated as inclusive (or <=) for class breaks.

    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 in a MapView.
        Parameters:
        description - the description
        label - the label
        minValue - the min value (exclusive or >) for this class break
        maxValue - the max value (inclusive or <=) for this class break
        symbol - the symbol to display for this class break; this can't be 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.
        Returns:
        the class min value
        Since:
        100.0.0
      • setMinValue

        public void setMinValue​(double minValue)
        Sets the class min value which is exclusive (or >) for this class break.
        Parameters:
        minValue - the new class min value
        Since:
        100.0.0
      • getMaxValue

        public double getMaxValue()
        Gets the class max value.
        Returns:
        the class max value
        Since:
        100.0.0
      • setMaxValue

        public void setMaxValue​(double maxValue)
        Sets the class max value which is inclusive (or <=) for this class break.
        Parameters:
        maxValue - the new class max value
        Since:
        100.0.0
      • getDescription

        public String getDescription()
        Gets the description.
        Returns:
        the description
        Since:
        100.0.0
      • setDescription

        public void setDescription​(String description)
        Sets the description.
        Parameters:
        description - the description
        Since:
        100.0.0
      • getLabel

        public String getLabel()
        Gets the label, suitable for showing in a legend.
        Returns:
        the label
        Since:
        100.0.0
      • setLabel

        public void setLabel​(String label)
        Sets the legend label, suitable for showing in a legend.
        Parameters:
        label - the new label
        Since:
        100.0.0
      • getSymbol

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

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