Package fj

Enum Digit

All Implemented Interfaces:
Serializable, Comparable<Digit>, java.lang.constant.Constable

public enum Digit extends Enum<Digit>
The digits zero to nine.
  • Enum Constant Details

    • _0

      public static final Digit _0
      Zero.
    • _1

      public static final Digit _1
      One.
    • _2

      public static final Digit _2
      Two.
    • _3

      public static final Digit _3
      Three.
    • _4

      public static final Digit _4
      Four.
    • _5

      public static final Digit _5
      Five.
    • _6

      public static final Digit _6
      Six.
    • _7

      public static final Digit _7
      Seven.
    • _8

      public static final Digit _8
      Eight.
    • _9

      public static final Digit _9
      Nine.
  • Field Details

    • toLong

      public static final F<Digit,Long> toLong
      First-class conversion from digit to a long.
    • fromLong

      public static final F<Long,Digit> fromLong
      First-class conversion from a long to a digit.
    • toChar

      public static final F<Digit,Character> toChar
      First-class conversion from a digit to a character.
    • fromChar

      public static final F<Character,Option<Digit>> fromChar
      First-class conversion from a character to a digit.
  • Constructor Details

    • Digit

      private Digit()
  • Method Details

    • values

      public static Digit[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static Digit valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified name
      NullPointerException - if the argument is null
    • toLong

      public long toLong()
      Converts this digit to a long.
      Returns:
      A long for this digit.
    • toChar

      public char toChar()
      Converts this digit to a character.
      Returns:
      A character for this digit.
    • fromLong

      public static Digit fromLong(long i)
      Converts the right-most digit in the given long value to a digit.
      Parameters:
      i - The long to convert.
      Returns:
      The right-most digit in the given long value as a digit.
    • fromChar

      public static Option<Digit> fromChar(char c)
      Converts the given character in the given long value to a digit.
      Parameters:
      c - The character to convert.
      Returns:
      The character in the given long value as a digit.