Enum Class IntegerFormat
- All Implemented Interfaces:
Serializable, Comparable<IntegerFormat>, Constable
Input formats for entering integers into a text field such as the
IntegerTextField or
FixedSizeIntegerTextField-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionformat(BigInteger value) Converts the given value into a string representation corresponding to this number format.Returns a descriptive name of this number format.getName()Returns the short name of this number format.Returns the prefix associated with this format.booleanReturn true if this format is intended only for non-negative values.Parses the given string into a BigInteger or null if the string is not properly structured for this number format.static IntegerFormatReturns the enum constant of this class with the specified name.static IntegerFormat[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
DEC
-
HEX
-
OCT
-
BIN
-
U_DEC
-
U_HEX
-
U_OCT
-
U_BIN
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
getName
Returns the short name of this number format.- Returns:
- the short name of this number format
-
getDescription
Returns a descriptive name of this number format.- Returns:
- a descriptive name of this number format
-
format
Converts the given value into a string representation corresponding to this number format.- Parameters:
value- the value to format into a string- Returns:
- A string representation of the given value.
-
parse
Parses the given string into a BigInteger or null if the string is not properly structured for this number format.- Parameters:
text- the text to parse into a BigInteger- Returns:
- the BigInteger interpretation of the given string for this number format.
-
getPrefix
Returns the prefix associated with this format.- Returns:
- the prefix associated with this format
-
isUnsigned
public boolean isUnsigned()Return true if this format is intended only for non-negative values. This is more of a hint to the client text field to determine if "-" characters are allowed to be entered.- Returns:
- true if this format is for unsigned numbers
-