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

Method repeat

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

Return a string consisting of the specified character, repeated. @param theChar the character to repeat @param length number of repetitions @return the string @exception IllegalArgumentException if length is negative.

(char theChar, final int length)

Source from the content-addressed store, hash-verified

96 * @exception IllegalArgumentException if <code>length</code> is negative.
97 */
98 public static String repeat(char theChar, final int length) {
99 if (length < 0) {
100 throw new IllegalArgumentException("bad length");
101 }
102 final char[] buf = new char[length];
103 Arrays.fill(buf, theChar);
104 return new String(buf);
105 }
106
107 /**
108 * Faster implementation of string splitting on a single character delimiter.

Callers 11

writeCollectedOutputMethod · 0.95
acceptMethod · 0.95
testSpacesMethod · 0.95
testRepeatMethod · 0.95
addSeparatorMethod · 0.95
addHeadingMethod · 0.95
spacesMethod · 0.95
getTableUsageStringMethod · 0.95
pulseFunction · 0.80

Calls 2

appendMethod · 0.65
toStringMethod · 0.65

Tested by 6

writeCollectedOutputMethod · 0.76
acceptMethod · 0.76
testSpacesMethod · 0.76
testRepeatMethod · 0.76