Enum Class SignPolicy

java.lang.Object
java.lang.Enum<SignPolicy>
net.time4j.format.expert.SignPolicy
All Implemented Interfaces:
Serializable, Comparable<SignPolicy>, java.lang.constant.Constable

public enum SignPolicy extends Enum<SignPolicy>

Determines a suitable strategy for handling numerical signs.

Note: Signs can usually only occur in ISO-8601-context. Therefore Time4J will never process signs in a localized way. That means signs are the ASCII-chars '+' and '-'. A sign precedes the sequence of numerical digits. Localized formats of elements with signs (for example in arab language) require a special ChronoPrinter and ChronoParser.

A parser will only pay attention to this configuration in strict mode.

Author:
Meno Hochschild
  • Enum Constant Details

    • SHOW_NEVER

      public static final SignPolicy SHOW_NEVER

      A sign will never be printed or accepted in parsing.

      This setting is the default.

    • SHOW_WHEN_NEGATIVE

      public static final SignPolicy SHOW_WHEN_NEGATIVE

      A positive sign will never be printed, but a negative sign is always printed.

      This setting is the default for proleptic years in ISO-8601 format if the year numbers have less than four, but not two digits.

    • SHOW_WHEN_BIG_NUMBER

      public static final SignPolicy SHOW_WHEN_BIG_NUMBER

      A positive sign will be printed if the numerical amount has more digits than specified.

      This setting is the default for proleptic years in ISO-8601-format if the year numbers have more than four digits. Negative signs will always be printed.

    • SHOW_ALWAYS

      public static final SignPolicy SHOW_ALWAYS

      The sign will always be printed.

  • Method Details

    • values

      public static SignPolicy[] 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 SignPolicy 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