MCPcopy Create free account
hub / github.com/antlr/codebuff / join

Method join

output/java_guava/1.4.18/UnsignedLongs.java:137–150  ·  view source on GitHub ↗

Returns a string containing the supplied unsigned long values separated by separator. For example, join("-", 1, 2, 3) returns the string "1-2-3". @param separator the text that should appear between consecutive values in the resulting string (but not at the start

(String separator, long... array)

Source from the content-addressed store, hash-verified

135
136
137 public static String join(String separator, long... array) {
138 checkNotNull(separator);
139 if (array.length == 0) {
140 return "";
141 }
142
143 // For pre-sizing a builder, just get the right order of magnitude
144 StringBuilder builder = new StringBuilder(array.length * 5);
145 builder.append(toString(array[0]));
146 for (int i = 1; i < array.length; i++) {
147 builder.append(separator).append(toString(array[i]));
148 }
149 return builder.toString();
150 }
151
152 /**
153 * Returns a comparator that compares two arrays of unsigned {@code long} values <a

Callers

nothing calls this directly

Calls 4

toStringMethod · 0.95
toStringMethod · 0.65
checkNotNullMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected