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

Method reverse

output/java_guava/1.4.17/Lists.java:853–863  ·  view source on GitHub ↗

Returns a reversed view of the specified list. For example, Lists.reverse(Arrays.asList(1, 2, 3)) returns a list containing 3, 2, 1. The returned list is backed by this list, so changes in the returned list are reflected in this list, and vice-versa. The returned list supports all of

(List<T> list)

Source from the content-addressed store, hash-verified

851
852
853 public static <T> List<T> reverse(List<T> list) {
854 if (list instanceof ImmutableList) {
855 return ((ImmutableList<T>) list).reverse();
856 } else if (list instanceof ReverseList) {
857 return ((ReverseList<T>) list).getForwardList();
858 } else if (list instanceof RandomAccess) {
859 return new RandomAccessReverseList<T>(list);
860 } else {
861 return new ReverseList<T>(list);
862 }
863 }
864
865 private static class ReverseList<T> extends AbstractList<T> {
866 private final List<T> forwardList;

Callers 15

descendingMultisetMethod · 0.45
reverseOrderMethod · 0.45
getEntryMethod · 0.45
MinMaxPriorityQueueMethod · 0.45
descendingIteratorMethod · 0.45
createDescendingSetMethod · 0.45
collectTypesMethod · 0.45
subListMethod · 0.45
createDescendingSetMethod · 0.45
reverseOrderMethod · 0.45

Calls 1

getForwardListMethod · 0.45

Tested by

no test coverage detected