Package org.intermine.metadata
Class TextTable
- java.lang.Object
-
- org.intermine.metadata.TextTable
-
public class TextTable extends java.lang.Object
A utility class for generating multi-column aligned text tables.- Author:
- Matthew Wakeling
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String[]
ROW_SEPARATOR
An 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 void
addRow(java.lang.String... row)
Adds a single row to the table.java.lang.String
toString()
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:
toString
in classjava.lang.Object
- Returns:
- a String, either empty or with a trailing newline
-
-