Package fj
Enum Digit
- All Implemented Interfaces:
Serializable
,Comparable<Digit>
,java.lang.constant.Constable
The digits zero to nine.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum Constants -
Field Summary
FieldsModifier and TypeFieldDescriptionFirst-class conversion from a character to a digit.First-class conversion from a long to a digit.First-class conversion from a digit to a character.First-class conversion from digit to a long. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfromChar
(char c) Converts the given character in the given long value to a digit.static Digit
fromLong
(long i) Converts the right-most digit in the given long value to a digit.char
toChar()
Converts this digit to a character.long
toLong()
Converts this digit to a long.static Digit
Returns the enum constant of this type with the specified name.static Digit[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
_0
Zero. -
_1
One. -
_2
Two. -
_3
Three. -
_4
Four. -
_5
Five. -
_6
Six. -
_7
Seven. -
_8
Eight. -
_9
Nine.
-
-
Field Details
-
toLong
First-class conversion from digit to a long. -
fromLong
First-class conversion from a long to a digit. -
toChar
First-class conversion from a digit to a character. -
fromChar
First-class conversion from a character to a digit.
-
-
Constructor Details
-
Digit
private Digit()
-
-
Method Details
-
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
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 nameNullPointerException
- 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
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
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.
-