public enum SimpleHorizontalAligner extends Enum<SimpleHorizontalAligner> implements Aligner
Modifier and Type | Method and Description |
---|---|
String[] |
align(String[] text,
int cellWidth,
int cellHeight)
Perform text alignment, returning a String array that MUST contain
cellHeight
lines, each of which MUST be cellWidth chars in length. |
static SimpleHorizontalAligner |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static SimpleHorizontalAligner[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final SimpleHorizontalAligner left
public static final SimpleHorizontalAligner center
public static final SimpleHorizontalAligner right
public static SimpleHorizontalAligner[] values()
for (SimpleHorizontalAligner c : SimpleHorizontalAligner.values()) System.out.println(c);
public static SimpleHorizontalAligner valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic String[] align(String[] text, int cellWidth, int cellHeight)
Aligner
cellHeight
lines, each of which MUST be cellWidth
chars in length.
Input array is guaranteed to contain lines that have length equal to cellWidth
.
There is no guarantee on the input number of lines though.
Copyright © 2017 Pivotal Software, Inc.. All rights reserved.