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

Method splitToList

corpus/java/training/guava/base/Splitter.java:408–420  ·  view source on GitHub ↗

Splits sequence into string components and returns them as an immutable list. If you want an Iterable which may be lazily evaluated, use #split(CharSequence). @param sequence the sequence of characters to split @return an immutable list of the segments split from the paramet

(CharSequence sequence)

Source from the content-addressed store, hash-verified

406 * @since 15.0
407 */
408 @Beta
409 public List<String> splitToList(CharSequence sequence) {
410 checkNotNull(sequence);
411
412 Iterator<String> iterator = splittingIterator(sequence);
413 List<String> result = new ArrayList<String>();
414
415 while (iterator.hasNext()) {
416 result.add(iterator.next());
417 }
418
419 return Collections.unmodifiableList(result);
420 }
421
422 /**
423 * Returns a {@code MapSplitter} which splits entries based on this splitter, and splits entries

Callers

nothing calls this directly

Calls 5

splittingIteratorMethod · 0.95
addMethod · 0.65
nextMethod · 0.65
checkNotNullMethod · 0.45
hasNextMethod · 0.45

Tested by

no test coverage detected