Interface IDisplayable

All Known Subinterfaces:
IQuantity, IRange<T>, ITypedQuantity<U>
All Known Implementing Classes:
QuantityRange

public interface IDisplayable
Interface for objects that can be formatted for human display purposes, using a formatting hint.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Identifier for formatters suitable when many items are typically shown, such as tables, overviews, etc.
    static final String
    Identifier for formatters which shows the value with maximum known precision, but still only as one value.
    static final String
    Identifier for formatters suitable for tool tips.
  • Method Summary

    Modifier and Type
    Method
    Description
    displayUsing(String formatHint)
    Format this object for display purposes, preferably using the formatter hinted by formatHint.
  • Field Details

    • AUTO

      static final String AUTO
      Identifier for formatters suitable when many items are typically shown, such as tables, overviews, etc. Relatively compact, but not overly so. Using reasonable precision for at-a-glance display. Such a formatter is expected to exist for all IDisplayable implementations.
      See Also:
    • EXACT

      static final String EXACT
      Identifier for formatters which shows the value with maximum known precision, but still only as one value. For quantities, this will often be similar to IQuantity.interactiveFormat(), but tweaked for display, such as using non-breaking space between number and unit, and in applicable locales, between number groups. Also, not always parsable constructs like custom units may be used.
      See Also:
    • VERBOSE

      static final String VERBOSE
      Identifier for formatters suitable for tool tips. For quantities, in addition to showing the exact value, like EXACT, the value may additionally be displayed in different units.
      See Also:
  • Method Details

    • displayUsing

      String displayUsing(String formatHint)
      Format this object for display purposes, preferably using the formatter hinted by formatHint. If no such formatter is defined for this type, the default formatter will be used.
      Parameters:
      formatHint - the format hint
      Returns:
      a formatted string according to the hinted (or default) formatter