Enum Class DateField.Granularity

java.lang.Object
java.lang.Enum<DateField.Granularity>
limn.components.date.DateField.Granularity
All Implemented Interfaces:
Serializable, Comparable<DateField.Granularity>, Constable
Enclosing class:
DateField

public static enum DateField.Granularity extends Enum<DateField.Granularity>
How fine a field goes: which segment is its last. A field that starts at the year edits down to this; one that starts at the hour edits from there down to it, and refuses the three date levels.

A closed list on purpose. A week, a quarter or a decade would each be a real piece of design — what the segment shows, what a range of them means — and a value in an open set that nobody had designed for would be a field that draws nothing.

A 1.x minor release may add constants to this enum: a switch over it needs a default branch.

  • Enum Constant Details

  • Method Details

    • values

      public static DateField.Granularity[] 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 DateField.Granularity 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