public class JustificationImpl extends Object implements Justification
Justification. | Modifier and Type | Field and Description |
|---|---|
private HorizontalAlignment |
alignment
The alignment.
|
private char |
filler
The character used to fill up.
|
private static String |
FORMAT_PATTERN
The pattern for the format.
|
private char |
mode
The mode of the
Justification. |
private static char |
MODE_DEFAULT
The character used to identify the default mode.
|
private static char |
MODE_TRUNCATE
The character used to identify the truncate mode.
|
private int |
width
The width of the justified string.
|
| Constructor and Description |
|---|
JustificationImpl(String format)
The constructor.
|
| Modifier and Type | Method and Description |
|---|---|
String |
justify(CharSequence value)
This method applies the justification to the given
value and returns the result. |
void |
justify(CharSequence value,
Appendable target)
This method applies the justification to the given
value and appends the result to the given target. |
String |
toString() |
private static final char MODE_TRUNCATE
private static final char MODE_DEFAULT
private static final String FORMAT_PATTERN
private final HorizontalAlignment alignment
private final char filler
private final int width
private final char mode
Justification.public JustificationImpl(String format)
format - is the justification-format.public String justify(CharSequence value)
Justificationvalue and returns the result.justify in interface Justificationvalue - is the string to justify.public void justify(CharSequence value, Appendable target) throws IOException
Justificationvalue and appends the result to the given target.justify in interface Justificationvalue - is the string to justify.target - is where to append the justified data.IOException - if caused by Appendable.append(CharSequence).Copyright © 2001–2016 mmm-Team. All rights reserved.