- java.lang.Object
-
- java.lang.Enum<TableStyle>
-
- org.refcodes.textual.TableStyle
-
- All Implemented Interfaces:
Serializable
,Comparable<TableStyle>
public enum TableStyle extends Enum<TableStyle>
The Enum TableStyle defines character sets for various box border styles.
-
-
Enum Constant Summary
-
Field Summary
Fields Modifier and Type Field Description static TableStyle
OTHER_TABLE_STYLE
Style displayed for sure when being under test (e.g.static TableStyle
UNICODE_TABLE_STYLE
Style supported Unicode capable terminals (when not being under test).static TableStyle
WINDOWS_TABLE_STYLE
Style displayed for sure when being on a Windows machine.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description TextBoxGrid
getBody()
Returns the table body's characters.TextBoxGrid
getHeader()
Returns the table header's characters.TextBoxGrid
getTail()
Returns the table tail's characters.static TableStyle
toRuntimeTableStyle()
Depending on the runtime environment (Windows, Linux, JUnit) we prefer different table styles as depending on the runtime environment not all characters used by the various table styles may be available.static TableStyle
toTableStyle(String aValue)
Retrieves aTableStyle
depending on the given string, ignoring the case as well as beeing graceful regarding "-" and "_",static TableStyle
valueOf(String name)
Returns the enum constant of this type with the specified name.static TableStyle[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
SINGLE_HEADER_SINGLE_BODY
public static final TableStyle SINGLE_HEADER_SINGLE_BODY
Representing a table style usingTextBoxStyle.SINGLE
for the header andTextBoxStyle.SINGLE
for the body.
-
DOUBLE_SINGLE_HEADER_SINGLE_BODY
public static final TableStyle DOUBLE_SINGLE_HEADER_SINGLE_BODY
Representing a table style usingTextBoxStyle.DOUBLE_SINGLE
for the header andTextBoxStyle.SINGLE
for the body.
-
DOUBLE_HEADER_DOUBLE_BODY
public static final TableStyle DOUBLE_HEADER_DOUBLE_BODY
Representing a table style usingTextBoxStyle.DOUBLE
for the header andTextBoxStyle.DOUBLE
for the body.
-
DOUBLE_SINGLE_HEADER_DOUBLE_SINGLE_BODY
public static final TableStyle DOUBLE_SINGLE_HEADER_DOUBLE_SINGLE_BODY
Representing a table style usingTextBoxStyle.DOUBLE_SINGLE
for the header andTextBoxStyle.DOUBLE_SINGLE
for the body.
-
SINGLE_DOUBLE_HEADER_SINGLE_BODY
public static final TableStyle SINGLE_DOUBLE_HEADER_SINGLE_BODY
Representing a table style usingTextBoxStyle.DOUBLE_SINGLE
for the header andTextBoxStyle.DOUBLE_SINGLE
for the body.
-
SINGLE_DOUBLE_HEADER_SINGLE_DOUBLE_BODY
public static final TableStyle SINGLE_DOUBLE_HEADER_SINGLE_DOUBLE_BODY
Representing a table style usingTextBoxStyle.SINGLE_DOUBLE
for the header andTextBoxStyle.SINGLE_DOUBLE
for the body.
-
DOUBLE_HEADER_DOUBLE_SINGLE_BODY
public static final TableStyle DOUBLE_HEADER_DOUBLE_SINGLE_BODY
Representing a table style usingTextBoxStyle.DOUBLE
for the header andTextBoxStyle.DOUBLE_SINGLE
for the body.
-
DOUBLE_SINGLE_HEADER_SINGLE_DASHED_BODY
public static final TableStyle DOUBLE_SINGLE_HEADER_SINGLE_DASHED_BODY
Representing a table style usingTextBoxStyle.DOUBLE_SINGLE
for the header andTextBoxStyle.DOUBLE_SINGLE
for the body.
-
BOLD_HEADER_SINGLE_BODY
public static final TableStyle BOLD_HEADER_SINGLE_BODY
Representing a table style usingTextBoxStyle.BOLD_HEADER_SINGLE_BODY
for the header andTextBoxStyle.SINGLE
for the body.
-
HYBRID_BOLD_HEADER_SINGLE_BODY
public static final TableStyle HYBRID_BOLD_HEADER_SINGLE_BODY
Representing a table style usingTextBoxStyle.HYBRID_BOLD_HEADER_SINGLE_BODY
for the header andTextBoxStyle.SINGLE
for the body.
-
ASCII_HEADER_ASCII_BODY
public static final TableStyle ASCII_HEADER_ASCII_BODY
Representing a table style usingTextBoxStyle.ASCII
for the header andTextBoxStyle.ASCII
for the body.
-
BLANK_HEADER_BLANK_BODY
public static final TableStyle BLANK_HEADER_BLANK_BODY
Representing a table style usingTextBoxStyle.BLANK
for the header andTextBoxStyle.BLANK
for the body.
-
SINGLE_BLANK_HEADER_SINGLE_BLANK_BODY
public static final TableStyle SINGLE_BLANK_HEADER_SINGLE_BLANK_BODY
Representing a table style usingTextBoxStyle.SINGLE_BLANK
for the header andTextBoxStyle.SINGLE_BLANK
for the body.
-
ASCII_BLANK_HEADER_ASCII_BLANK_BODY
public static final TableStyle ASCII_BLANK_HEADER_ASCII_BLANK_BODY
Representing a table style usingTextBoxStyle.ASCII_BLANK
for the header andTextBoxStyle.ASCII_BLANK
for the body.
-
-
Field Detail
-
UNICODE_TABLE_STYLE
public static final TableStyle UNICODE_TABLE_STYLE
Style supported Unicode capable terminals (when not being under test).
-
WINDOWS_TABLE_STYLE
public static final TableStyle WINDOWS_TABLE_STYLE
Style displayed for sure when being on a Windows machine.
-
OTHER_TABLE_STYLE
public static final TableStyle OTHER_TABLE_STYLE
Style displayed for sure when being under test (e.g. JUnit) or in a Cp1252 or a plain "xterm".
-
-
Method Detail
-
values
public static TableStyle[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (TableStyle c : TableStyle.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static TableStyle valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
getHeader
public TextBoxGrid getHeader()
Returns the table header's characters.- Returns:
- The table header characters.
-
getBody
public TextBoxGrid getBody()
Returns the table body's characters.- Returns:
- The table body characters.
-
getTail
public TextBoxGrid getTail()
Returns the table tail's characters.- Returns:
- The table header characters.
-
toTableStyle
public static TableStyle toTableStyle(String aValue)
Retrieves aTableStyle
depending on the given string, ignoring the case as well as beeing graceful regarding "-" and "_",- Parameters:
aValue
- The name of theTableStyle
to be interpreted graceful.- Returns:
- The
TableStyle
being determined.
-
toRuntimeTableStyle
public static TableStyle toRuntimeTableStyle()
Depending on the runtime environment (Windows, Linux, JUnit) we prefer different table styles as depending on the runtime environment not all characters used by the various table styles may be available.- Returns:
- The
TableStyle
by default fitting best for the current environment.
-
-