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

public static enum DefaultFormatSpec.ConversionType extends Enum<DefaultFormatSpec.ConversionType>
  • Enum Constant Details

    • STRING

      public static final DefaultFormatSpec.ConversionType STRING
      (string) String format. This is the default type for strings and may be omitted.
    • BINARY

      public static final DefaultFormatSpec.ConversionType BINARY
      (int) Binary format. Outputs the number in base 2.
    • CHARACTER

      public static final DefaultFormatSpec.ConversionType CHARACTER
      (int) Character. Converts the integer to the corresponding unicode character before printing.
    • DECIMAL

      public static final DefaultFormatSpec.ConversionType DECIMAL
      (int) Decimal Integer. Outputs the number in base 10.
    • OCTAL

      public static final DefaultFormatSpec.ConversionType OCTAL
      (int) Octal format. Outputs the number in base 8.
    • LOWERCASE_HEX

      public static final DefaultFormatSpec.ConversionType LOWERCASE_HEX
      (int) Hex format. Outputs the number in base 16, using lower-case letters for the digits above 9.
    • UPPERCASE_HEX

      public static final DefaultFormatSpec.ConversionType 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

      public static final DefaultFormatSpec.ConversionType 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

      public static final DefaultFormatSpec.ConversionType UPPERCASE_SCIENTIFIC_NOTATION
      (float) Same as LOWERCASE_SCIENTIFIC_NOTATION except it uses an upper case ‘E’ as the separator character.
    • LOWERCASE_FIXED_POINT

      public static final DefaultFormatSpec.ConversionType 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

      public static final DefaultFormatSpec.ConversionType UPPERCASE_FIXED_POINT
      (float) Same as LOWERCASE_FIXED_POINT but converts "nan" to "NAN" and "inf" to "INF"
    • LOWERCASE_GENERAL

      public static final DefaultFormatSpec.ConversionType 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 type LOWERCASE_SCIENTIFIC_NOTATION and 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

      public static final DefaultFormatSpec.ConversionType UPPERCASE_GENERAL
      (float) Same as LOWERCASE_GENERAL, except switches to {#UPPERCASE_SCIENTIFIC_NOTATION} if the number gets too large. The representations of infinity and NaN are uppercased, too.
    • LOCALE_SENSITIVE

      public static final DefaultFormatSpec.ConversionType LOCALE_SENSITIVE
      (int, float) Locale sensitive number output. For integers, same as DECIMAL but it will use the current locale's number seperator. For floats, same as LOWERCASE_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

      public static final DefaultFormatSpec.ConversionType PERCENTAGE
      (float) Percentage. Multiplies the number by 100 and displays in LOWERCASE_FIXED_POINT format, followed by a percent sign.
  • Method Details

    • values

      public static DefaultFormatSpec.ConversionType[] 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

      public static DefaultFormatSpec.ConversionType valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • fromString

      public static DefaultFormatSpec.ConversionType fromString(String text)