Class PluralFormatter

java.lang.Object
com.pnfsoftware.jeb.util.format.PluralFormatter

public class PluralFormatter extends Object
A text formatter that takes quantities into account to produce singular-form or plural-form tokens.
  • Constructor Details

    • PluralFormatter

      public PluralFormatter()
  • Method Details

    • count

      public static String count(Number cnt, String value, String valuePlural)
      Produce the singular or plural form of a token based on a provided count.
      Parameters:
      cnt - count
      value - singular token
      valuePlural - plural token
      Returns:
    • countS

      public static String countS(Number cnt, String value)
      A specialized version of count that assumes that the plural form of a provided singular token is created by appending the 's' character to the singular token.
      Parameters:
      cnt - count
      value - singular token
      Returns: