public static enum TextTable.Box extends Enum<TextTable.Box> implements TextTable.Style
Preset styles, specifying the characters used to draw the lines and corners
of a table
. As of now, the whole table is drawn with the same
set of characters (we don't allow to customize per row or per cell).
You don't need to use this class if you prefer to provide your own styles.
TextTable.presetBox(Style)
Enum Constant and Description |
---|
ASCII
Plain ASCII - suitable for every log file
|
ASCII_HORIZONTAL |
ASCII_HORIZONTAL_DOUBLE |
NO_BOX
No decorations - good start if you want to customize
|
UNICODE_DOUBLE
Because sometimes two is better than one
|
UNICODE_THICK
Sturdy and solid, nothing stands out quite like UNICODE_THICK
|
UNICODE_THIN
Stylish and slim, spruce your stdio with UNICODE_THIN
|
UNICODE_THIN_ROUNDED
...but how about drawing rectangles with rounded corners? Can we do that now, too?
|
Modifier and Type | Method and Description |
---|---|
@Nullable String |
horizontal()
Determines the characters used to draw the horizontal lines of a table.
|
@NotNull String[] |
joints(int row)
Determines the characters used to draw the joints and corners of a table.
|
static TextTable.Box |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static TextTable.Box[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
@Nullable String |
vertical()
Determines the characters used to draw the vertical lines of a table.
|
public static final TextTable.Box NO_BOX
public static final TextTable.Box ASCII_HORIZONTAL
public static final TextTable.Box ASCII_HORIZONTAL_DOUBLE
public static final TextTable.Box ASCII
public static final TextTable.Box UNICODE_THIN
public static final TextTable.Box UNICODE_THIN_ROUNDED
public static final TextTable.Box UNICODE_THICK
public static final TextTable.Box UNICODE_DOUBLE
public static TextTable.Box[] values()
for (TextTable.Box c : TextTable.Box.values()) System.out.println(c);
public static TextTable.Box 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 null@Contract(pure=true) @Nullable public @Nullable String horizontal()
TextTable.Style
horizontal
in interface TextTable.Style
null
, horizontal separators will be skipped entirely.TextTable.style
,
TextTable.presetBox(Style)
@Contract(pure=true) @Nullable public @Nullable String vertical()
TextTable.Style
vertical
in interface TextTable.Style
null
, vertical separators will be skipped entirely.TextTable.style
,
TextTable.presetBox(Style)
@Contract(pure=true) @NotNull public @NotNull String[] joints(int row)
TextTable.Style
String[][] joints = { { TOP_LEFT_CORNER , TOP_T_JOINT , TOP_RIGHT_CORNER }, { LEFT_T_JOINT , CROSS_JOINT , RIGHT_T_JOINT }, { BOTTOM_LEFT_CORNER , BOTTOM_T_JOINT , BOTTOM_RIGHT_CORNER }, }
joints
in interface TextTable.Style
row
- which row of the 9-box to return.row
.
See examples in TextTable.Box
.TextTable.style
,
TextTable.presetBox(Style)