Package org.tomitribe.crest.table
Class Border
- java.lang.Object
-
- org.tomitribe.crest.table.Border
-
public class Border extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBorder.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Border.BuilderasciiCompact()Col1 Col2 Col3 Numeric Column ---------------------------------- --------- ------------------------ ---------------- Value 1 Value 2 123 10.0 Separate cols with a tab or 4 spaces -2,027.1 This is a row with only one cellstatic Border.BuilderasciiDots()........................................................................................static Border.BuilderasciiSeparated()+==================================+=========+========================+================+ | Col1 | Col2 | Col3 | Numeric Column | +==================================+=========+========================+================+ | Value 1 | Value 2 | 123 | 10.0 | +----------------------------------+---------+------------------------+----------------+ | Separate | cols | with a tab or 4 spaces | -2,027.1 | +----------------------------------+---------+------------------------+----------------+ | This is a row with only one cell | | | | +----------------------------------+---------+------------------------+----------------+static Border.Builderbuilder()static Border.Buildercsv()java.lang.Stringescape(java.lang.String value)LinegetFirst()LinegetHeader()LinegetInner()LinegetLast()LinegetRow()java.lang.StringgetRowFormat(java.util.List<Data.Column> columns)WidthgetWidth(int columns)static Border.BuildergithubMarkdown()| Col1 | Col2 | Col3 | Numeric Column | |----------------------------------|---------|------------------------|----------------| | Value 1 | Value 2 | 123 | 10.0 | | Separate | cols | with a tab or 4 spaces | -2,027.1 | | This is a row with only one cell | | | |static Border.BuildermysqlStyle()+----------------------------------+---------+------------------------+----------------+ | Col1 | Col2 | Col3 | Numeric Column | +----------------------------------+---------+------------------------+----------------+ | Value 1 | Value 2 | 123 | 10.0 | | Separate | cols | with a tab or 4 spaces | -2,027.1 | | This is a row with only one cell | | | | +----------------------------------+---------+------------------------+----------------+static Border.BuilderredditMarkdown()Col1 | Col2 | Col3 | Numeric Column ----------------------------------|---------|------------------------|---------------- Value 1 | Value 2 | 123 | 10.0 Separate | cols | with a tab or 4 spaces | -2,027.1 This is a row with only one cell | | |static Border.BuilderreStructuredTextGrid()+----------------------------------+---------+------------------------+----------------+ | Col1 | Col2 | Col3 | Numeric Column | +==================================+=========+========================+================+ | Value 1 | Value 2 | 123 | 10.0 | | Separate | cols | with a tab or 4 spaces | -2,027.1 | | This is a row with only one cell | | | | +----------------------------------+---------+------------------------+----------------+static Border.BuilderreStructuredTextSimple()================================== ========= ======================== ================ Col1 Col2 Col3 Numeric Column ================================== ========= ======================== ================ Value 1 Value 2 123 10.0 Separate cols with a tab or 4 spaces -2,027.1 This is a row with only one cell ================================== ========= ======================== ================static Border.Buildertsv()static Border.BuilderunicodeDouble()╔══════════════════════════════════╦═════════╦════════════════════════╦════════════════╗ ║ Col1 ║ Col2 ║ Col3 ║ Numeric Column ║ ╠══════════════════════════════════╬═════════╬════════════════════════╬════════════════╣ ║ Value 1 ║ Value 2 ║ 123 ║ 10.0 ║ ║ Separate ║ cols ║ with a tab or 4 spaces ║ -2,027.1 ║ ║ This is a row with only one cell ║ ║ ║ ║ ╚══════════════════════════════════╩═════════╩════════════════════════╩════════════════╝static Border.BuilderunicodeSingle()┌──────────────────────────────────┬─────────┬────────────────────────┬────────────────┐ │ Col1 │ Col2 │ Col3 │ Numeric Column │ ├──────────────────────────────────┼─────────┼────────────────────────┼────────────────┤ │ Value 1 │ Value 2 │ 123 │ 10.0 │ │ Separate │ cols │ with a tab or 4 spaces │ -2,027.1 │ │ This is a row with only one cell │ │ │ │ └──────────────────────────────────┴─────────┴────────────────────────┴────────────────┘static Border.BuilderunicodeSingleSeparated()┌──────────────────────────────────┬─────────┬────────────────────────┬────────────────┐ │ Col1 │ Col2 │ Col3 │ Numeric Column │ ├──────────────────────────────────┼─────────┼────────────────────────┼────────────────┤ │ Value 1 │ Value 2 │ 123 │ 10.0 │ ├──────────────────────────────────┼─────────┼────────────────────────┼────────────────┤ │ Separate │ cols │ with a tab or 4 spaces │ -2,027.1 │ ├──────────────────────────────────┼─────────┼────────────────────────┼────────────────┤ │ This is a row with only one cell │ │ │ │ └──────────────────────────────────┴─────────┴────────────────────────┴────────────────┘static Border.BuilderwhitespaceCompact()Col1 Col2 Col3 Numeric Column Value 1 Value 2 123 10.0 Separate cols with a tab or 4 spaces -2,027.1 This is a row with only one cellstatic Border.BuilderwhitespaceSeparated()Col1 Col2 Col3 Numeric Column Value 1 Value 2 123 10.0 Separate cols with a tab or 4 spaces -2,027.1 This is a row with only one cell
-
-
-
Method Detail
-
escape
public java.lang.String escape(java.lang.String value)
-
getRowFormat
public java.lang.String getRowFormat(java.util.List<Data.Column> columns)
-
getFirst
public Line getFirst()
-
getLast
public Line getLast()
-
getHeader
public Line getHeader()
-
getInner
public Line getInner()
-
getRow
public Line getRow()
-
getWidth
public Width getWidth(int columns)
-
whitespaceSeparated
public static Border.Builder whitespaceSeparated()
Col1 Col2 Col3 Numeric Column Value 1 Value 2 123 10.0 Separate cols with a tab or 4 spaces -2,027.1 This is a row with only one cell
-
whitespaceCompact
public static Border.Builder whitespaceCompact()
Col1 Col2 Col3 Numeric Column Value 1 Value 2 123 10.0 Separate cols with a tab or 4 spaces -2,027.1 This is a row with only one cell
-
mysqlStyle
public static Border.Builder mysqlStyle()
+----------------------------------+---------+------------------------+----------------+ | Col1 | Col2 | Col3 | Numeric Column | +----------------------------------+---------+------------------------+----------------+ | Value 1 | Value 2 | 123 | 10.0 | | Separate | cols | with a tab or 4 spaces | -2,027.1 | | This is a row with only one cell | | | | +----------------------------------+---------+------------------------+----------------+
-
asciiSeparated
public static Border.Builder asciiSeparated()
+==================================+=========+========================+================+ | Col1 | Col2 | Col3 | Numeric Column | +==================================+=========+========================+================+ | Value 1 | Value 2 | 123 | 10.0 | +----------------------------------+---------+------------------------+----------------+ | Separate | cols | with a tab or 4 spaces | -2,027.1 | +----------------------------------+---------+------------------------+----------------+ | This is a row with only one cell | | | | +----------------------------------+---------+------------------------+----------------+
-
asciiCompact
public static Border.Builder asciiCompact()
Col1 Col2 Col3 Numeric Column ---------------------------------- --------- ------------------------ ---------------- Value 1 Value 2 123 10.0 Separate cols with a tab or 4 spaces -2,027.1 This is a row with only one cell
-
githubMarkdown
public static Border.Builder githubMarkdown()
| Col1 | Col2 | Col3 | Numeric Column | |----------------------------------|---------|------------------------|----------------| | Value 1 | Value 2 | 123 | 10.0 | | Separate | cols | with a tab or 4 spaces | -2,027.1 | | This is a row with only one cell | | | |
-
redditMarkdown
public static Border.Builder redditMarkdown()
Col1 | Col2 | Col3 | Numeric Column ----------------------------------|---------|------------------------|---------------- Value 1 | Value 2 | 123 | 10.0 Separate | cols | with a tab or 4 spaces | -2,027.1 This is a row with only one cell | | |
-
reStructuredTextGrid
public static Border.Builder reStructuredTextGrid()
+----------------------------------+---------+------------------------+----------------+ | Col1 | Col2 | Col3 | Numeric Column | +==================================+=========+========================+================+ | Value 1 | Value 2 | 123 | 10.0 | | Separate | cols | with a tab or 4 spaces | -2,027.1 | | This is a row with only one cell | | | | +----------------------------------+---------+------------------------+----------------+
-
reStructuredTextSimple
public static Border.Builder reStructuredTextSimple()
================================== ========= ======================== ================ Col1 Col2 Col3 Numeric Column ================================== ========= ======================== ================ Value 1 Value 2 123 10.0 Separate cols with a tab or 4 spaces -2,027.1 This is a row with only one cell ================================== ========= ======================== ================
-
asciiDots
public static Border.Builder asciiDots()
........................................................................................ : Col1 : Col2 : Col3 : Numeric Column : :..................................:.........:........................:................: : Value 1 : Value 2 : 123 : 10.0 : : Separate : cols : with a tab or 4 spaces : -2,027.1 : : This is a row with only one cell : : : : :..................................:.........:........................:................:
-
unicodeDouble
public static Border.Builder unicodeDouble()
╔══════════════════════════════════╦═════════╦════════════════════════╦════════════════╗ ║ Col1 ║ Col2 ║ Col3 ║ Numeric Column ║ ╠══════════════════════════════════╬═════════╬════════════════════════╬════════════════╣ ║ Value 1 ║ Value 2 ║ 123 ║ 10.0 ║ ║ Separate ║ cols ║ with a tab or 4 spaces ║ -2,027.1 ║ ║ This is a row with only one cell ║ ║ ║ ║ ╚══════════════════════════════════╩═════════╩════════════════════════╩════════════════╝
-
unicodeSingle
public static Border.Builder unicodeSingle()
┌──────────────────────────────────┬─────────┬────────────────────────┬────────────────┐ │ Col1 │ Col2 │ Col3 │ Numeric Column │ ├──────────────────────────────────┼─────────┼────────────────────────┼────────────────┤ │ Value 1 │ Value 2 │ 123 │ 10.0 │ │ Separate │ cols │ with a tab or 4 spaces │ -2,027.1 │ │ This is a row with only one cell │ │ │ │ └──────────────────────────────────┴─────────┴────────────────────────┴────────────────┘
-
unicodeSingleSeparated
public static Border.Builder unicodeSingleSeparated()
┌──────────────────────────────────┬─────────┬────────────────────────┬────────────────┐ │ Col1 │ Col2 │ Col3 │ Numeric Column │ ├──────────────────────────────────┼─────────┼────────────────────────┼────────────────┤ │ Value 1 │ Value 2 │ 123 │ 10.0 │ ├──────────────────────────────────┼─────────┼────────────────────────┼────────────────┤ │ Separate │ cols │ with a tab or 4 spaces │ -2,027.1 │ ├──────────────────────────────────┼─────────┼────────────────────────┼────────────────┤ │ This is a row with only one cell │ │ │ │ └──────────────────────────────────┴─────────┴────────────────────────┴────────────────┘
-
tsv
public static Border.Builder tsv()
-
csv
public static Border.Builder csv()
-
builder
public static Border.Builder builder()
-
-