Package ai.timefold.jpyinterpreter.util
Enum Class DefaultFormatSpec.ConversionType
java.lang.Object
java.lang.Enum<DefaultFormatSpec.ConversionType>
ai.timefold.jpyinterpreter.util.DefaultFormatSpec.ConversionType
- All Implemented Interfaces:
Serializable,Comparable<DefaultFormatSpec.ConversionType>,Constable
- Enclosing class:
- DefaultFormatSpec
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescription(int) Binary format.(int) Character.(int) Decimal Integer.(int, float) Locale sensitive number output.(float) Fixed-point notation.(float) General format.(int) Hex format.(float) Scientific notation.(int) Octal format.(float) Percentage.(string) String format.(float) Same asLOWERCASE_FIXED_POINTbut converts "nan" to "NAN" and "inf" to "INF"(float) Same asLOWERCASE_GENERAL, except switches to {#UPPERCASE_SCIENTIFIC_NOTATION} if the number gets too large.(int) Hex format.(float) Same asLOWERCASE_SCIENTIFIC_NOTATIONexcept it uses an upper case ‘E’ as the separator character. -
Method Summary
Modifier and TypeMethodDescriptionfromString(String text) Returns the enum constant of this class with the specified name.static DefaultFormatSpec.ConversionType[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
STRING
(string) String format. This is the default type for strings and may be omitted. -
BINARY
(int) Binary format. Outputs the number in base 2. -
CHARACTER
(int) Character. Converts the integer to the corresponding unicode character before printing. -
DECIMAL
(int) Decimal Integer. Outputs the number in base 10. -
OCTAL
(int) Octal format. Outputs the number in base 8. -
LOWERCASE_HEX
(int) Hex format. Outputs the number in base 16, using lower-case letters for the digits above 9. -
UPPERCASE_HEX
(int) Hex format. Outputs the number in base 16, using upper-case letters for the digits above 9. In case '#' is specified, the prefix '0x' will be upper-cased to '0X' as well. -
LOWERCASE_SCIENTIFIC_NOTATION
(float) Scientific notation. For a given precision p, formats the number in scientific notation with the letter ‘e’ separating the coefficient from the exponent. The coefficient has one digit before and p digits after the decimal point, for a total of p + 1 significant digits. With no precision given, uses a precision of 6 digits after the decimal point for float, and shows all coefficient digits for Decimal. If no digits follow the decimal point, the decimal point is also removed unless the # option is used. -
UPPERCASE_SCIENTIFIC_NOTATION
(float) Same asLOWERCASE_SCIENTIFIC_NOTATIONexcept it uses an upper case ‘E’ as the separator character. -
LOWERCASE_FIXED_POINT
(float) Fixed-point notation. For a given precision p, formats the number as a decimal number with exactly p digits following the decimal point. With no precision given, uses a precision of 6 digits after the decimal point for float, and uses a precision large enough to show all coefficient digits for Decimal. If no digits follow the decimal point, the decimal point is also removed unless the # option is used. -
UPPERCASE_FIXED_POINT
(float) Same asLOWERCASE_FIXED_POINTbut converts "nan" to "NAN" and "inf" to "INF" -
LOWERCASE_GENERAL
(float) General format. For a given precision p >= 1, this rounds the number to p significant digits and then formats the result in either fixed-point format or in scientific notation, depending on its magnitude. A precision of 0 is treated as equivalent to a precision of 1. The precise rules are as follows: suppose that the result formatted with presentation typeLOWERCASE_SCIENTIFIC_NOTATIONand precision p-1 would have exponent exp. Then, if m ≤ exp < p, where m is -4 for floats and -6 for Decimals, the number is formatted with presentation type 'f'and precision p-1-exp. Otherwise, the number is formatted with presentation type 'e' and precision p-1. In both cases insignificant trailing zeros are removed from the significand, and the decimal point is also removed if there are no remaining digits following it, unless the '#' option is used. With no precision given, uses a precision of 6 significant digits for float. For Decimal, the coefficient of the result is formed from the coefficient digits of the value; scientific notation is used for values smaller than 1e-6 in absolute value and values where the place value of the least significant digit is larger than 1, and fixed-point notation is used otherwise. Positive and negative infinity, positive and negative zero, and nans, are formatted as inf, -inf, 0, -0 and nan respectively, regardless of the precision. -
UPPERCASE_GENERAL
(float) Same asLOWERCASE_GENERAL, except switches to {#UPPERCASE_SCIENTIFIC_NOTATION} if the number gets too large. The representations of infinity and NaN are uppercased, too. -
LOCALE_SENSITIVE
(int, float) Locale sensitive number output. For integers, same asDECIMALbut it will use the current locale's number seperator. For floats, same asLOWERCASE_GENERAL, except that when fixed-point notation is used to format the result, it always includes at least one digit past the decimal point. The precision used is as large as needed to represent the given value faithfully. -
PERCENTAGE
(float) Percentage. Multiplies the number by 100 and displays inLOWERCASE_FIXED_POINTformat, followed by a percent sign.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException- if the argument is null
-
fromString
-