Top Description Fields Constructors Methods
com.univocity.parsers.fixed

public final Enum FieldAlignment

extends Enum<FieldAlignment>
Class Inheritance

Alignment of text in a fixed-width field.
Author
Univocity Software Pty Ltd - [email protected]

Field Summary

Modifier and TypeField and Description
public static final FieldAlignment
CENTER

Centralizes values

public static final FieldAlignment
LEFT

Aligns values to the left

public static final FieldAlignment
RIGHT

Aligns values to the right

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

the number of whites paces to introduce in before the value to make it align as specified.
calculatePadding
(int
the total length available to write for a given field
totalLength
,
int
the length of a value that will be written to the field
lengthToWrite
)

Calculates how many whites paces to introduce before a value so it is printed as specified by the alignment type.

public static FieldAlignment
public static FieldAlignment[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

CENTERback to summary
public static final FieldAlignment CENTER

Centralizes values

LEFTback to summary
public static final FieldAlignment LEFT

Aligns values to the left

Constructor Detail

FieldAlignmentback to summary
private FieldAlignment()

Method Detail

calculatePaddingback to summary
public 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.

Parameters
totalLength:int

the total length available to write for a given field

lengthToWrite:int

the length of a value that will be written to the field

Returns:int

the number of whites paces to introduce in before the value to make it align as specified.

valueOfback to summary
public static FieldAlignment valueOf(String name)
valuesback to summary
public static FieldAlignment[] values()