public enum NumberSystem extends Enum<NumberSystem>
Defines the number system.
| Enum Constant and Description |
|---|
ARABIC
Arabic numbers with digits 0-9 (default setting).
|
ETHIOPIC
Ethiopic numerals.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(char digit)
Does this number system contains given digit char?
|
int |
toInteger(String numeral)
Converts given text numeral to an integer.
|
String |
toNumeral(int number)
Converts given integer to a text numeral.
|
static NumberSystem |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static NumberSystem[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final NumberSystem ARABIC
public static final NumberSystem ETHIOPIC
See also A Look at Ethiopic Numerals.
public static NumberSystem[] values()
for (NumberSystem c : NumberSystem.values()) System.out.println(c);
public static NumberSystem valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic String toNumeral(int number)
Converts given integer to a text numeral.
number - number to be displayed as textIllegalArgumentException - if the conversion is not supported for given numberpublic int toInteger(String numeral)
Converts given text numeral to an integer.
numeral - text numeral to be evaluated as numberArithmeticException - if int-range overflowspublic boolean contains(char digit)
Does this number system contains given digit char?
digit - numerical char to be checkedCopyright © 2014–2015. All rights reserved.