public final class FixedWidthFormatter extends AbstractMultiLineFormatter
MultiLineFormatter
for fixed width text cells.
All white space is converted to plain spaces.
When flow policy is WORD_WRAP
, newlines in the
source are treated as preferred line breaks.
Modifier and Type | Class and Description |
---|---|
static class |
FixedWidthFormatter.Align
Alignment constants.
|
static class |
FixedWidthFormatter.Flow
Flow constants.
|
Constructor and Description |
---|
FixedWidthFormatter(FixedWidthFormatter.Align alignment,
FixedWidthFormatter.Flow flow,
int width)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
transform(StringBuilder buffer,
StringBuilder remainder)
Alter buffer to contain a single line according to the policy of
the formatter.
|
format
public FixedWidthFormatter(FixedWidthFormatter.Align alignment, FixedWidthFormatter.Flow flow, int width)
alignment
- Alignment policy. One of { ALIGN_LEFT
, ALIGN_CENTRE
, ALIGN_RIGHT
}flow
- Flow policy. One of { FLOW_TRUNCATE
, FLOW_WRAP
,
FLOW_WORD_WRAP
, FLOW_OVERFLOW
}width
- The cell width.public void transform(StringBuilder buffer, StringBuilder remainder)
remainder
.buffer
- Buffer to transform to a single line.remainder
- Leftovers.Copyright © 2000-2014. All Rights Reserved.