Class AbstractCategoryItemLabelGenerator

    • Constructor Detail

      • AbstractCategoryItemLabelGenerator

        protected AbstractCategoryItemLabelGenerator​(String labelFormat,
                                                     NumberFormat formatter)
        Creates a label generator with the specified number formatter.
        Parameters:
        labelFormat - the label format string (null not permitted).
        formatter - the number formatter (null not permitted).
      • AbstractCategoryItemLabelGenerator

        protected AbstractCategoryItemLabelGenerator​(String labelFormat,
                                                     NumberFormat formatter,
                                                     NumberFormat percentFormatter)
        Creates a label generator with the specified number formatter.
        Parameters:
        labelFormat - the label format string (null not permitted).
        formatter - the number formatter (null not permitted).
        percentFormatter - the percent formatter (null not permitted).
        Since:
        1.0.2
      • AbstractCategoryItemLabelGenerator

        protected AbstractCategoryItemLabelGenerator​(String labelFormat,
                                                     DateFormat formatter)
        Creates a label generator with the specified date formatter.
        Parameters:
        labelFormat - the label format string (null not permitted).
        formatter - the date formatter (null not permitted).
    • Method Detail

      • generateRowLabel

        public String generateRowLabel​(CategoryDataset dataset,
                                       int row)
        Generates a label for the specified row.
        Parameters:
        dataset - the dataset (null not permitted).
        row - the row index (zero-based).
        Returns:
        The label.
      • generateColumnLabel

        public String generateColumnLabel​(CategoryDataset dataset,
                                          int column)
        Generates a label for the specified row.
        Parameters:
        dataset - the dataset (null not permitted).
        column - the column index (zero-based).
        Returns:
        The label.
      • getLabelFormat

        public String getLabelFormat()
        Returns the label format string.
        Returns:
        The label format string (never null).
      • getNumberFormat

        public NumberFormat getNumberFormat()
        Returns the number formatter.
        Returns:
        The number formatter (possibly null).
      • getDateFormat

        public DateFormat getDateFormat()
        Returns the date formatter.
        Returns:
        The date formatter (possibly null).
      • generateLabelString

        protected String generateLabelString​(CategoryDataset dataset,
                                             int row,
                                             int column)
        Generates a for the specified item.
        Parameters:
        dataset - the dataset (null not permitted).
        row - the row index (zero-based).
        column - the column index (zero-based).
        Returns:
        The label (possibly null).
      • createItemArray

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

        public boolean equals​(Object obj)
        Tests this object for equality with an arbitrary object.
        Overrides:
        equals in class 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 Object
        Returns:
        A hash code.