Enum StringFormatPart.Flag
- All Implemented Interfaces:
Serializable
,Comparable<StringFormatPart.Flag>
,java.lang.constant.Constable
- Enclosing class:
StringFormatPart
The flags for the string message format.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe result should use a conversion-dependent alternate form.The result will always include a sign.The result will be left-justified.The result will include locale-specific grouping separators.The result will enclose negative numbers in parentheses.The previous position.The result will include a leading space for positive values.The result will be zero-padded. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringFormatPart.Flag
parse
(char c) Checks to see if the character is a valid flag.toString()
static StringFormatPart.Flag
Returns the enum constant of this type with the specified name.static StringFormatPart.Flag[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
LEFT_JUSTIFY
The result will be left-justified. Works on all conversions. -
CONVERSION_DEPENDENT_ALTERNATE
The result should use a conversion-dependent alternate form. Works on conversionsStringFormatPart.Conversion.OCTAL_INTEGER
,StringFormatPart.Conversion.HEX_INTEGER
, all floating points and most general conversions depending on the definition ofFormattable
. -
INCLUDE_SIGN
The result will always include a sign. Works on all floating points,StringFormatPart.Conversion.DECIMAL_INTEGER
,StringFormatPart.Conversion.OCTAL_INTEGER
,StringFormatPart.Conversion.HEX_INTEGER
when applied toBigInteger
orStringFormatPart.Conversion.DECIMAL_INTEGER
when applied tobyte
,Byte
,short
,Short
,int
,Integer
,long
andLong
. -
SPACE_FOR_POSITIVE_VALUES
The result will include a leading space for positive values. Works on all floating points,StringFormatPart.Conversion.DECIMAL_INTEGER
,StringFormatPart.Conversion.OCTAL_INTEGER
,StringFormatPart.Conversion.HEX_INTEGER
when applied toBigInteger
orStringFormatPart.Conversion.DECIMAL_INTEGER
when applied tobyte
,Byte
,short
,Short
,int
,Integer
,long
andLong
. -
ZERO_PADDED
The result will be zero-padded. Works on all integrals and floating points. -
LOCALE_GROUPING_SEPARATOR
The result will include locale-specific grouping separators. Works only onStringFormatPart.Conversion.DECIMAL_INTEGER
integrals andStringFormatPart.Conversion.SCIENTIFIC_NOTATION
,StringFormatPart.Conversion.DECIMAL
andStringFormatPart.Conversion.SCIENTIFIC_NOTATION_OR_DECIMAL
floating points. -
PARENTHESES_FOR_NEGATIVES
The result will enclose negative numbers in parentheses. Works only onStringFormatPart.Conversion.DECIMAL_INTEGER
,StringFormatPart.Conversion.OCTAL_INTEGER
,StringFormatPart.Conversion.HEX_INTEGER
when applied toBigInteger
orStringFormatPart.Conversion.DECIMAL_INTEGER
when applied tobyte
,Byte
,short
,Short
,int
,Integer
,long
andLong
integrals andStringFormatPart.Conversion.SCIENTIFIC_NOTATION
,StringFormatPart.Conversion.DECIMAL
andStringFormatPart.Conversion.SCIENTIFIC_NOTATION_OR_DECIMAL
floating points. -
PREVIOUS
The previous position.
-
-
Field Details
-
flag
final char flagThe character flag.
-
-
Constructor Details
-
Flag
private Flag(char flag)
-
-
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
-
toString
- Overrides:
toString
in classEnum<StringFormatPart.Flag>
-
parse
Checks to see if the character is a valid flag.- Parameters:
c
- the character to check.- Returns:
- the corresponding flag for the character.
- Throws:
UnknownFormatFlagsException
- if the flag is invalid.
-