MCPcopy Index your code
hub / github.com/apache/groovy / tails

Method tails

src/main/java/groovy/util/GroovyCollections.java:110–118  ·  view source on GitHub ↗

@since 2.5.0

(Iterable<T> collections)

Source from the content-addressed store, hash-verified

108 * @since 2.5.0
109 */
110 public static <T> List<List<T>> tails(Iterable<T> collections) {
111 List<T> copy = DefaultGroovyMethods.toList(collections);
112 List<List<T>> result = new ArrayList<>();
113 for (int i = 0; i <= copy.size(); i++) {
114 List<T> next = copy.subList(i, copy.size());
115 result.add(next);
116 }
117 return result;
118 }
119
120 /**
121 * Finds all non-empty subsequences of a list.

Callers 1

tailsMethod · 0.95

Calls 4

toListMethod · 0.95
sizeMethod · 0.65
addMethod · 0.65
subListMethod · 0.45

Tested by

no test coverage detected