Package org.intermine.metadata
Class TextTable
- java.lang.Object
-
- org.intermine.metadata.TextTable
-
public class TextTable extends java.lang.ObjectA utility class for generating multi-column aligned text tables.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String[]ROW_SEPARATORAn object representing a horizontal line separating two rows - treated as a row.
-
Constructor Summary
Constructors Constructor Description TextTable(boolean leftBound, boolean columnSeparators, boolean rightBound)Creates a new TextTable object, with or without column separating lines.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddRow(java.lang.String... row)Adds a single row to the table.java.lang.StringtoString()Returns a text-formatted representation of this table.
-
-
-
Constructor Detail
-
TextTable
public TextTable(boolean leftBound, boolean columnSeparators, boolean rightBound)Creates a new TextTable object, with or without column separating lines.- Parameters:
leftBound- true for a vertical line to the left of the leftmost columncolumnSeparators- true for vertical lines separating the columnsrightBound- true for a vertical line to the right of the rightmost column
-
-
Method Detail
-
addRow
public void addRow(java.lang.String... row)
Adds a single row to the table.- Parameters:
row- an array of Strings - each String being a column
-
toString
public java.lang.String toString()
Returns a text-formatted representation of this table.- Overrides:
toStringin classjava.lang.Object- Returns:
- a String, either empty or with a trailing newline
-
-