Class PluralRules

  • All Implemented Interfaces:
    java.io.Serializable

    public class PluralRules
    extends java.lang.Object
    implements java.io.Serializable
    See Also:
    Serialized Form
    • Method Detail

      • parse

        public static PluralRules parse​(java.lang.String rule)
                                 throws java.text.ParseException
        Parses a plural rules string and returns a PluralRules.
        Parameters:
        rule - the rule string.
        Throws:
        java.text.ParseException
      • parse

        public static PluralRules parse​(java.util.Map<java.lang.String,​java.lang.String> rules)
                                 throws java.text.ParseException
        Throws:
        java.text.ParseException
      • getInstance

        public static PluralRules getInstance​(java.lang.String rule)
        Creates a PluralRules from a rule if it is parsable, otherwise returns null.
        Parameters:
        description - the rule rule.
        Returns:
        the PluralRules
      • getInstance

        public static PluralRules getInstance​(java.util.Map<java.lang.String,​java.lang.String> rule)
      • select

        public java.lang.String select​(double number)
        Given a number, returns the keyword of the first rule that applies to the number.
        Parameters:
        number - The number for which the rule has to be determined.
        Returns:
        The keyword of the selected rule.
      • select

        @Deprecated
        public java.lang.String select​(PluralRules.FixedDecimal number)
        Deprecated.
        Parameters:
        number -
        Returns:
      • getRules

        public java.lang.String getRules​(java.lang.String keyword)