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

Method reverse

corpus/java/training/guava/collect/Lists.java:823–833  ·  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

821 * @since 7.0
822 */
823 public static <T> List<T> reverse(List<T> list) {
824 if (list instanceof ImmutableList) {
825 return ((ImmutableList<T>) list).reverse();
826 } else if (list instanceof ReverseList) {
827 return ((ReverseList<T>) list).getForwardList();
828 } else if (list instanceof RandomAccess) {
829 return new RandomAccessReverseList<T>(list);
830 } else {
831 return new ReverseList<T>(list);
832 }
833 }
834
835 private static class ReverseList<T> extends AbstractList<T> {
836 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
subListMethod · 0.45
createDescendingSetMethod · 0.45
reverseOrderMethod · 0.45
reverseOrderMethod · 0.45

Calls 1

getForwardListMethod · 0.45

Tested by

no test coverage detected