1 /* 2 * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. Oracle designates this 8 * particular file as subject to the "Classpath" exception as provided 9 * by Oracle in the LICENSE file that accompanied this code. 10 * 11 * This code is distributed in the hope that it will be useful, but WITHOUT 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 * version 2 for more details (a copy is included in the LICENSE file that 15 * accompanied this code). 16 * 17 * You should have received a copy of the GNU General Public License version 18 * 2 along with this work; if not, write to the Free Software Foundation, 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 * 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 26 package sun.security.util; 27 28 import java.lang.ref.*; 29 import java.util.*; 30 31 @SuppressWarnings({"unchecked", "deprecation", "all"}) 32 public abstract class Cache<K, V> { 33 34 @android.compat.annotation.UnsupportedAppUsage Cache()35 protected Cache() { 36 throw new RuntimeException("Stub!"); 37 } 38 size()39 public abstract int size(); 40 41 @android.compat.annotation.UnsupportedAppUsage clear()42 public abstract void clear(); 43 44 @android.compat.annotation.UnsupportedAppUsage put(K key, V value)45 public abstract void put(K key, V value); 46 47 @android.compat.annotation.UnsupportedAppUsage get(java.lang.Object key)48 public abstract V get(java.lang.Object key); 49 remove(java.lang.Object key)50 public abstract void remove(java.lang.Object key); 51 setCapacity(int size)52 public abstract void setCapacity(int size); 53 setTimeout(int timeout)54 public abstract void setTimeout(int timeout); 55 accept(sun.security.util.Cache.CacheVisitor<K, V> visitor)56 public abstract void accept(sun.security.util.Cache.CacheVisitor<K, V> visitor); 57 newSoftMemoryCache(int size)58 public static <K, V> sun.security.util.Cache<K, V> newSoftMemoryCache(int size) { 59 throw new RuntimeException("Stub!"); 60 } 61 newSoftMemoryCache(int size, int timeout)62 public static <K, V> sun.security.util.Cache<K, V> newSoftMemoryCache(int size, int timeout) { 63 throw new RuntimeException("Stub!"); 64 } 65 66 @android.compat.annotation.UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553) newHardMemoryCache(int size)67 public static <K, V> sun.security.util.Cache<K, V> newHardMemoryCache(int size) { 68 throw new RuntimeException("Stub!"); 69 } 70 newNullCache()71 public static <K, V> sun.security.util.Cache<K, V> newNullCache() { 72 throw new RuntimeException("Stub!"); 73 } 74 newHardMemoryCache(int size, int timeout)75 public static <K, V> sun.security.util.Cache<K, V> newHardMemoryCache(int size, int timeout) { 76 throw new RuntimeException("Stub!"); 77 } 78 79 @SuppressWarnings({"unchecked", "deprecation", "all"}) 80 public static interface CacheVisitor<K, V> { 81 visit(java.util.Map<K, V> map)82 public void visit(java.util.Map<K, V> map); 83 } 84 85 @SuppressWarnings({"unchecked", "deprecation", "all"}) 86 public static class EqualByteArray { 87 EqualByteArray(byte[] b)88 public EqualByteArray(byte[] b) { 89 throw new RuntimeException("Stub!"); 90 } 91 hashCode()92 public int hashCode() { 93 throw new RuntimeException("Stub!"); 94 } 95 equals(java.lang.Object obj)96 public boolean equals(java.lang.Object obj) { 97 throw new RuntimeException("Stub!"); 98 } 99 100 private final byte[] b; 101 102 { 103 b = new byte[0]; 104 } 105 106 private volatile int hash; 107 } 108 } 109