MCPcopy Create free account
hub / github.com/RealTimeGenomics/rtg-tools / addHeading

Method addHeading

src/main/java/com/rtg/util/RstTable.java:87–98  ·  view source on GitHub ↗

Add a heading to the table @param text the heading text

(String text)

Source from the content-addressed store, hash-verified

85 * @param text the heading text
86 */
87 public void addHeading(String text) {
88 if (text.length() > mHeaderWidth) {
89 throw new IllegalArgumentException("Header text too wide, expected: " + mHeaderWidth + " got: " + text.length());
90 }
91 addSeparator();
92 mTable.append(String.format("|" + widthString(mSpacing) + widthString(mHeaderWidth) + widthString(mSpacing) + "|%n", "", text, ""));
93 for (int width : mWidths) {
94 mTable.append("+").append(StringUtils.repeat("=", width + mSpacing * 2));
95 }
96 mTable.append("+");
97 mTable.append(StringUtils.LS);
98 }
99
100 /**
101 * Add a row to the table

Callers 2

testMethod · 0.95
appendTableFlagUsageMethod · 0.95

Calls 6

addSeparatorMethod · 0.95
widthStringMethod · 0.95
repeatMethod · 0.95
lengthMethod · 0.65
appendMethod · 0.65
formatMethod · 0.45

Tested by 1

testMethod · 0.76