Coverage Summary for Class: JdkBackedImmutableSet (com.google.common.collect)
| Class | Class, % | Method, % | Line, % |
|---|---|---|---|
| JdkBackedImmutableSet | 0% (0/1) | 0% (0/5) | 0% (0/7) |
1 /* 2 * Copyright (C) 2018 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.GwtCompatible; 18 import java.util.Set; 19 import javax.annotation.CheckForNull; 20 21 /** 22 * ImmutableSet implementation backed by a JDK HashSet, used to defend against apparent hash 23 * flooding. This implementation is never used on the GWT client side, but it must be present there 24 * for serialization to work. 25 * 26 * @author Louis Wasserman 27 */ 28 @GwtCompatible(serializable = true) 29 @ElementTypesAreNonnullByDefault 30 final class JdkBackedImmutableSet<E> extends IndexedImmutableSet<E> { 31 private final Set<?> delegate; 32 private final ImmutableList<E> delegateList; 33 34 JdkBackedImmutableSet(Set<?> delegate, ImmutableList<E> delegateList) { 35 this.delegate = delegate; 36 this.delegateList = delegateList; 37 } 38 39 @Override 40 E get(int index) { 41 return delegateList.get(index); 42 } 43 44 @Override 45 public boolean contains(@CheckForNull Object object) { 46 return delegate.contains(object); 47 } 48 49 @Override 50 boolean isPartialView() { 51 return false; 52 } 53 54 @Override 55 public int size() { 56 return delegateList.size(); 57 } 58 }