- 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 TableStyleOTHER_TABLE_STYLEStyle displayed for sure when being under test (e.g.static TableStyleUNICODE_TABLE_STYLEStyle supported Unicode capable terminals (when not being under test).static TableStyleWINDOWS_TABLE_STYLEStyle displayed for sure when being on a Windows machine.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description TextBoxGridgetBody()Returns the table body's characters.TextBoxGridgetHeader()Returns the table header's characters.TextBoxGridgetTail()Returns the table tail's characters.static TableStyletoRuntimeTableStyle()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 TableStyletoTableStyle(String aValue)Retrieves aTableStyledepending on the given string, ignoring the case as well as beeing graceful regarding "-" and "_",static TableStylevalueOf(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.SINGLEfor the header andTextBoxStyle.SINGLEfor the body.
-
DOUBLE_SINGLE_HEADER_SINGLE_BODY
public static final TableStyle DOUBLE_SINGLE_HEADER_SINGLE_BODY
Representing a table style usingTextBoxStyle.DOUBLE_SINGLEfor the header andTextBoxStyle.SINGLEfor the body.
-
DOUBLE_HEADER_DOUBLE_BODY
public static final TableStyle DOUBLE_HEADER_DOUBLE_BODY
Representing a table style usingTextBoxStyle.DOUBLEfor the header andTextBoxStyle.DOUBLEfor the body.
-
DOUBLE_SINGLE_HEADER_DOUBLE_SINGLE_BODY
public static final TableStyle DOUBLE_SINGLE_HEADER_DOUBLE_SINGLE_BODY
Representing a table style usingTextBoxStyle.DOUBLE_SINGLEfor the header andTextBoxStyle.DOUBLE_SINGLEfor the body.
-
SINGLE_DOUBLE_HEADER_SINGLE_BODY
public static final TableStyle SINGLE_DOUBLE_HEADER_SINGLE_BODY
Representing a table style usingTextBoxStyle.DOUBLE_SINGLEfor the header andTextBoxStyle.DOUBLE_SINGLEfor the body.
-
SINGLE_DOUBLE_HEADER_SINGLE_DOUBLE_BODY
public static final TableStyle SINGLE_DOUBLE_HEADER_SINGLE_DOUBLE_BODY
Representing a table style usingTextBoxStyle.SINGLE_DOUBLEfor the header andTextBoxStyle.SINGLE_DOUBLEfor the body.
-
DOUBLE_HEADER_DOUBLE_SINGLE_BODY
public static final TableStyle DOUBLE_HEADER_DOUBLE_SINGLE_BODY
Representing a table style usingTextBoxStyle.DOUBLEfor the header andTextBoxStyle.DOUBLE_SINGLEfor the body.
-
DOUBLE_SINGLE_HEADER_SINGLE_DASHED_BODY
public static final TableStyle DOUBLE_SINGLE_HEADER_SINGLE_DASHED_BODY
Representing a table style usingTextBoxStyle.DOUBLE_SINGLEfor the header andTextBoxStyle.DOUBLE_SINGLEfor the body.
-
BOLD_HEADER_SINGLE_BODY
public static final TableStyle BOLD_HEADER_SINGLE_BODY
Representing a table style usingTextBoxStyle.BOLD_HEADER_SINGLE_BODYfor the header andTextBoxStyle.SINGLEfor 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_BODYfor the header andTextBoxStyle.SINGLEfor the body.
-
ASCII_HEADER_ASCII_BODY
public static final TableStyle ASCII_HEADER_ASCII_BODY
Representing a table style usingTextBoxStyle.ASCIIfor the header andTextBoxStyle.ASCIIfor the body.
-
BLANK_HEADER_BLANK_BODY
public static final TableStyle BLANK_HEADER_BLANK_BODY
Representing a table style usingTextBoxStyle.BLANKfor the header andTextBoxStyle.BLANKfor the body.
-
SINGLE_BLANK_HEADER_SINGLE_BLANK_BODY
public static final TableStyle SINGLE_BLANK_HEADER_SINGLE_BLANK_BODY
Representing a table style usingTextBoxStyle.SINGLE_BLANKfor the header andTextBoxStyle.SINGLE_BLANKfor the body.
-
ASCII_BLANK_HEADER_ASCII_BLANK_BODY
public static final TableStyle ASCII_BLANK_HEADER_ASCII_BLANK_BODY
Representing a table style usingTextBoxStyle.ASCII_BLANKfor the header andTextBoxStyle.ASCII_BLANKfor 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 aTableStyledepending on the given string, ignoring the case as well as beeing graceful regarding "-" and "_",- Parameters:
aValue- The name of theTableStyleto be interpreted graceful.- Returns:
- The
TableStylebeing 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
TableStyleby default fitting best for the current environment.
-
-