MCPcopy
hub / github.com/google/guava / split

Method split

guava/src/com/google/common/base/Splitter.java:366–383  ·  view source on GitHub ↗

Splits {@code sequence} into string components and makes them available through an {@link Iterator}, which may be lazily evaluated. If you want an eagerly computed {@link List}, use {@link #splitToList(CharSequence)}. Java 8+ users may prefer {@link #splitToStream} instead. @param sequence the sequ

(CharSequence sequence)

Source from the content-addressed store, hash-verified

364 * @return an iteration over the segments split from the parameter
365 */
366 public Iterable<String> split(CharSequence sequence) {
367 checkNotNull(sequence);
368
369 return new Iterable<String>() {
370 @Override
371 public Iterator<String> iterator() {
372 return splittingIterator(sequence);
373 }
374
375 @Override
376 public String toString() {
377 return Joiner.on(", ")
378 .appendTo(new StringBuilder().append('['), this)
379 .append(']')
380 .toString();
381 }
382 };
383 }
384
385 private Iterator<String> splittingIterator(CharSequence sequence) {
386 return strategy.iterator(this, sequence);

Callers 15

splitToStreamMethod · 0.95
doExtensiveTestMethod · 0.95
parseJavaClassPathMethod · 0.45
simplifyPathMethod · 0.45
linesIteratorMethod · 0.45
splitMethod · 0.45
InternetDomainNameMethod · 0.45
charSplitterMethod · 0.45
stringSplitterMethod · 0.45
testComputeIfPresentMethod · 0.45

Calls 1

checkNotNullMethod · 0.45

Tested by 15

doExtensiveTestMethod · 0.76
charSplitterMethod · 0.36
stringSplitterMethod · 0.36
testComputeIfPresentMethod · 0.36
parseJavaClassPathMethod · 0.36
parseJavaClassPathMethod · 0.36
testSplitNullStringMethod · 0.36
testToStringMethod · 0.36