public class

PluralFormatter

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

Class Overview

A text formatter that takes quantities into account to produce singular-form or plural-form tokens.

Summary

Public Constructors
PluralFormatter()
Public Methods
static String count(Number cnt, String value, String valuePlural)
Produce the singular or plural form of a token based on a provided count.
static String countS(Number cnt, String value)
A specialized version of #count(int, String, String) count that assumes that the plural form of a provided singular token is created by appending the 's' character to the singular token.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public PluralFormatter ()

Public Methods

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

public static String countS (Number cnt, String value)

A specialized version of #count(int, String, String) 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