Package org.daisy.dotify.api.formatter
Enum NumeralStyle
- java.lang.Object
-
- java.lang.Enum<NumeralStyle>
-
- org.daisy.dotify.api.formatter.NumeralStyle
-
- All Implemented Interfaces:
Serializable
,Comparable<NumeralStyle>
public enum NumeralStyle extends Enum<NumeralStyle>
Defines numeral styles.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ALPHA
Defines alpha numeral style, alias of UPPER_ALPHA.DECIMAL
Defines a decimal numeral style.DECIMAL_LEADING_ZERO
Defines a number with a single leading zero if the number is < 10 (01, 02, 03, etc.).DEFAULT
Defines default numeral style, alias of DECIMAL.LOWER_ALPHA
Defines lower alpha numeral style.LOWER_ROMAN
Defines lower roman numeral style.ROMAN
Defines roman numeral style, alias of UPPER_ROMAN.UPPER_ALPHA
Defines upper alpha numeral style.UPPER_ROMAN
Defines upper roman numeral style.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
format(int i)
Formats the numeral with the given style.static NumeralStyle
valueOf(String name)
Returns the enum constant of this type with the specified name.static NumeralStyle[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
DEFAULT
public static final NumeralStyle DEFAULT
Defines default numeral style, alias of DECIMAL.
-
DECIMAL
public static final NumeralStyle DECIMAL
Defines a decimal numeral style.
-
DECIMAL_LEADING_ZERO
public static final NumeralStyle DECIMAL_LEADING_ZERO
Defines a number with a single leading zero if the number is < 10 (01, 02, 03, etc.).
-
ROMAN
public static final NumeralStyle ROMAN
Defines roman numeral style, alias of UPPER_ROMAN.
-
UPPER_ROMAN
public static final NumeralStyle UPPER_ROMAN
Defines upper roman numeral style.
-
LOWER_ROMAN
public static final NumeralStyle LOWER_ROMAN
Defines lower roman numeral style.
-
ALPHA
public static final NumeralStyle ALPHA
Defines alpha numeral style, alias of UPPER_ALPHA.
-
UPPER_ALPHA
public static final NumeralStyle UPPER_ALPHA
Defines upper alpha numeral style.
-
LOWER_ALPHA
public static final NumeralStyle LOWER_ALPHA
Defines lower alpha numeral style.
-
-
Method Detail
-
values
public static NumeralStyle[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (NumeralStyle c : NumeralStyle.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static NumeralStyle valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
format
public String format(int i)
Formats the numeral with the given style.- Parameters:
i
- the number- Returns:
- returns the formatted number
-
-