Enum Class BracketPolicy

java.lang.Object
java.lang.Enum<BracketPolicy>
net.time4j.range.BracketPolicy
All Implemented Interfaces:
Serializable, Comparable<BracketPolicy>, java.lang.constant.Constable

public enum BracketPolicy extends Enum<BracketPolicy>

Determines a suitable strategy for formatting the open or closed state of interval boundaries.

An open boundary will be printed as leading "(" or as trailing ")". A closed boundary will be printed as leading "[" or as trailing "]".

Since:
2.0
Author:
Meno Hochschild
  • Enum Constant Details

    • SHOW_WHEN_NON_STANDARD

      public static final BracketPolicy SHOW_WHEN_NON_STANDARD

      The brackets indicating the open or closed state of a boundary will be printed if the boundary state deviates from standard.

      This setting is the default. Calendrical intervals are closed by default. All other intervals are half-open (right-open). Infinite intervals are always printed with brackets.

    • SHOW_ALWAYS

      public static final BracketPolicy SHOW_ALWAYS

      The brackets indicating the open or closed state of a boundary will always be printed.

    • SHOW_NEVER

      public static final BracketPolicy SHOW_NEVER

      The brackets indicating the open or closed state of a boundary will never be printed.

  • Method Details

    • values

      public static BracketPolicy[] 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 BracketPolicy 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
    • display

      public boolean display(ChronoInterval<?> interval)

      Decides if to display the boundaries of given interval.

      Parameters:
      interval - interval whose boundaries are to be printed or not
      Returns:
      true if boundaries are displayed else false
      Since:
      2.0