Class MultipleXYSeriesLabelGenerator

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String additionalFormatPattern
      The format pattern for additional labels.
      static java.lang.String DEFAULT_LABEL_FORMAT
      The default item label format.
      private java.lang.String formatPattern
      The format pattern for the initial part of the label.
      private static long serialVersionUID
      For serialization.
      private java.util.Map seriesLabelLists
      Storage for the additional series labels.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addSeriesLabel​(int series, java.lang.String label)
      Adds an extra label for the specified series.
      void clearSeriesLabels​(int series)
      Clears the extra labels for the specified series.
      java.lang.Object clone()
      Returns an independent copy of the generator.
      protected java.lang.Object[] createItemArray​(XYDataset dataset, int series)
      Creates the array of items that can be passed to the MessageFormat class for creating labels.
      boolean equals​(java.lang.Object obj)
      Tests this object for equality with an arbitrary object.
      java.lang.String generateLabel​(XYDataset dataset, int series)
      Generates a label for the specified series.
      int hashCode()
      Returns a hash code for this instance.
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • serialVersionUID

        private static final long serialVersionUID
        For serialization.
        See Also:
        Constant Field Values
      • DEFAULT_LABEL_FORMAT

        public static final java.lang.String DEFAULT_LABEL_FORMAT
        The default item label format.
        See Also:
        Constant Field Values
      • formatPattern

        private java.lang.String formatPattern
        The format pattern for the initial part of the label.
      • additionalFormatPattern

        private java.lang.String additionalFormatPattern
        The format pattern for additional labels.
      • seriesLabelLists

        private java.util.Map seriesLabelLists
        Storage for the additional series labels.
    • Constructor Detail

      • MultipleXYSeriesLabelGenerator

        public MultipleXYSeriesLabelGenerator()
        Creates an item label generator using default number formatters.
      • MultipleXYSeriesLabelGenerator

        public MultipleXYSeriesLabelGenerator​(java.lang.String format)
        Creates a new series label generator.
        Parameters:
        format - the format pattern (null not permitted).
    • Method Detail

      • addSeriesLabel

        public void addSeriesLabel​(int series,
                                   java.lang.String label)
        Adds an extra label for the specified series.
        Parameters:
        series - the series index.
        label - the label.
      • clearSeriesLabels

        public void clearSeriesLabels​(int series)
        Clears the extra labels for the specified series.
        Parameters:
        series - the series index.
      • generateLabel

        public java.lang.String generateLabel​(XYDataset dataset,
                                              int series)
        Generates a label for the specified series. This label will be used for the chart legend.
        Specified by:
        generateLabel in interface XYSeriesLabelGenerator
        Parameters:
        dataset - the dataset (null not permitted).
        series - the series.
        Returns:
        A series label.
      • createItemArray

        protected java.lang.Object[] createItemArray​(XYDataset dataset,
                                                     int series)
        Creates the array of items that can be passed to the MessageFormat class for creating labels.
        Parameters:
        dataset - the dataset (null not permitted).
        series - the series (zero-based index).
        Returns:
        The items (never null).
      • clone

        public java.lang.Object clone()
                               throws java.lang.CloneNotSupportedException
        Returns an independent copy of the generator.
        Specified by:
        clone in interface PublicCloneable
        Overrides:
        clone in class java.lang.Object
        Returns:
        A clone.
        Throws:
        java.lang.CloneNotSupportedException - if cloning is not supported.
      • equals

        public boolean equals​(java.lang.Object obj)
        Tests this object for equality with an arbitrary object.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        obj - the other object (null permitted).
        Returns:
        A boolean.
      • hashCode

        public int hashCode()
        Returns a hash code for this instance.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        A hash code.