public enum FieldAlignment extends java.lang.Enum<FieldAlignment>
Enum Constant | Description |
---|---|
CENTER |
Centralizes values
|
LEFT |
Aligns values to the left
|
RIGHT |
Aligns values to the right
|
Modifier and Type | Method | Description |
---|---|---|
int |
calculatePadding(int totalLength,
int lengthToWrite) |
Calculates how many whites paces to introduce before a value so it is printed as specified by the alignment type.
|
static FieldAlignment |
valueOf(java.lang.String name) |
Returns the enum constant of this type with the specified name.
|
static FieldAlignment[] |
values() |
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final FieldAlignment LEFT
public static final FieldAlignment CENTER
public static final FieldAlignment RIGHT
public static FieldAlignment[] values()
for (FieldAlignment c : FieldAlignment.values()) System.out.println(c);
public static FieldAlignment valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic int calculatePadding(int totalLength, int lengthToWrite)
totalLength
- the total length available to write for a given fieldlengthToWrite
- the length of a value that will be written to the field