Package org.anchoranalysis.core.value
Class LanguageUtilities
Object
LanguageUtilities
Utility functions for pluralizing words in strings.
- Author:
- Owen Feehan
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringmultiplexPlural(long number, String single, String plural) Returns a single or plural word depending on the number.static StringGivensomething, returnssomethings.static StringpluralizeMaybe(long number, String word) Returnssomethingorsomethingsdepending on the number.static StringprefixPluralize(long number, String word) Returnsn somethings.static StringprefixPluralizeMaybe(long number, String word) Returns1 somethingorn somethingsas is appropriate.
-
Method Details
-
pluralizeMaybe
Returnssomethingorsomethingsdepending on the number.- Parameters:
number- the number nword- the something- Returns:
- the string as above
-
multiplexPlural
Returns a single or plural word depending on the number.- Parameters:
number- the number that determines which word to use.single- the string to use whennumberis singular.plural- the string to use whennumberis pural.- Returns:
singleorpluraldepending onnumber.
-
prefixPluralizeMaybe
Returns1 somethingorn somethingsas is appropriate.- Parameters:
number- the number nword- the something- Returns:
- the string as above
-
prefixPluralize
Returnsn somethings.- Parameters:
number- the number.word- the something.- Returns:
- the string as above.
-
pluralize
Givensomething, returnssomethings.- Parameters:
word- the something.- Returns:
- the string as above.
-