Class NumberRenderer<SOURCE>

Type Parameters:
SOURCE - the type of the input item, from which the number is extracted
All Implemented Interfaces:
Serializable

public class NumberRenderer<SOURCE> extends BasicRenderer<SOURCE,Number>
A renderer for presenting number values.
Author:
Vaadin Ltd
See Also:
  • Constructor Details

    • NumberRenderer

      protected NumberRenderer(ValueProvider<SOURCE,Number> valueProvider)
      Creates a new number renderer.

      The renderer is configured to render with the number's natural string representation in the default locale.

      Parameters:
      valueProvider - the callback to provide a Number to the renderer, not null
    • NumberRenderer

      public NumberRenderer(ValueProvider<SOURCE,Number> valueProvider, NumberFormat numberFormat)
      Creates a new number renderer.

      The renderer is configured to render the number as defined with the given number format.

      Parameters:
      valueProvider - the callback to provide a Number to the renderer, not null
      numberFormat - the number format with which to display numbers, not null
    • NumberRenderer

      public NumberRenderer(ValueProvider<SOURCE,Number> valueProvider, NumberFormat numberFormat, String nullRepresentation)
      Creates a new number renderer.

      The renderer is configured to render the number as defined with the given number format.

      Parameters:
      valueProvider - the callback to provide a Number to the renderer, not null
      numberFormat - the number format with which to display numbers, not null
      nullRepresentation - the textual representation of null value
    • NumberRenderer

      public NumberRenderer(ValueProvider<SOURCE,Number> valueProvider, Locale locale)
      Creates a new number renderer.

      The renderer is configured to render with the number's natural string representation in the given locale.

      Parameters:
      valueProvider - the callback to provide a Number to the renderer, not null
      locale - the locale in which to display numbers
    • NumberRenderer

      public NumberRenderer(ValueProvider<SOURCE,Number> valueProvider, String formatString, Locale locale)
      Creates a new number renderer.

      The renderer is configured to render with the number's natural string representation in the given locale.

      Parameters:
      valueProvider - the callback to provide a Number to the renderer, not null
      formatString - the format string with which to format the number, not null
      locale - the locale in which to display numbers, not null
    • NumberRenderer

      public NumberRenderer(ValueProvider<SOURCE,Number> valueProvider, String formatString)
      Creates a new number renderer.

      The renderer is configured to render with the given format string in the default locale.

      Parameters:
      valueProvider - the callback to provide a Number to the renderer, not null
      formatString - the format string with which to format the number, not null
      See Also:
    • NumberRenderer

      public NumberRenderer(ValueProvider<SOURCE,Number> valueProvider, String formatString, Locale locale, String nullRepresentation)
      Creates a new number renderer.

      The renderer is configured to render with the given format string in the given locale.

      Parameters:
      valueProvider - the callback to provide a Number to the renderer, not null
      formatString - the format string with which to format the number, not null
      locale - the locale in which to present numbers, not null
      nullRepresentation - the textual representation of null value
      See Also:
  • Method Details