Coverage Summary for Class: DescendingImmutableSortedMultiset (com.google.common.collect)
| Class | Class, % | Method, % | Line, % |
|---|---|---|---|
| DescendingImmutableSortedMultiset | 0% (0/1) | 0% (0/11) | 0% (0/13) |
1 /* 2 * Copyright (C) 2011 The Guava Authors 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 * in compliance with the License. You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software distributed under the License 10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 * or implied. See the License for the specific language governing permissions and limitations under 12 * the License. 13 */ 14 15 package com.google.common.collect; 16 17 import com.google.common.annotations.GwtIncompatible; 18 import javax.annotation.CheckForNull; 19 20 /** 21 * A descending wrapper around an {@code ImmutableSortedMultiset} 22 * 23 * @author Louis Wasserman 24 */ 25 @SuppressWarnings("serial") // uses writeReplace, not default serialization 26 @GwtIncompatible 27 @ElementTypesAreNonnullByDefault 28 final class DescendingImmutableSortedMultiset<E> extends ImmutableSortedMultiset<E> { 29 private final transient ImmutableSortedMultiset<E> forward; 30 31 DescendingImmutableSortedMultiset(ImmutableSortedMultiset<E> forward) { 32 this.forward = forward; 33 } 34 35 @Override 36 public int count(@CheckForNull Object element) { 37 return forward.count(element); 38 } 39 40 @Override 41 @CheckForNull 42 public Entry<E> firstEntry() { 43 return forward.lastEntry(); 44 } 45 46 @Override 47 @CheckForNull 48 public Entry<E> lastEntry() { 49 return forward.firstEntry(); 50 } 51 52 @Override 53 public int size() { 54 return forward.size(); 55 } 56 57 @Override 58 public ImmutableSortedSet<E> elementSet() { 59 return forward.elementSet().descendingSet(); 60 } 61 62 @Override 63 Entry<E> getEntry(int index) { 64 return forward.entrySet().asList().reverse().get(index); 65 } 66 67 @Override 68 public ImmutableSortedMultiset<E> descendingMultiset() { 69 return forward; 70 } 71 72 @Override 73 public ImmutableSortedMultiset<E> headMultiset(E upperBound, BoundType boundType) { 74 return forward.tailMultiset(upperBound, boundType).descendingMultiset(); 75 } 76 77 @Override 78 public ImmutableSortedMultiset<E> tailMultiset(E lowerBound, BoundType boundType) { 79 return forward.headMultiset(lowerBound, boundType).descendingMultiset(); 80 } 81 82 @Override 83 boolean isPartialView() { 84 return forward.isPartialView(); 85 } 86 }