Home
last modified time | relevance | path

Searched refs:K (Results 1 – 25 of 46) sorted by relevance

12

/libcore/ojluni/src/main/java/java/util/
DNavigableMap.java96 public interface NavigableMap<K,V> extends SortedMap<K,V> {
110 Map.Entry<K,V> lowerEntry(K key); in lowerEntry()
124 K lowerKey(K key); in lowerKey()
139 Map.Entry<K,V> floorEntry(K key); in floorEntry()
153 K floorKey(K key); in floorKey()
168 Map.Entry<K,V> ceilingEntry(K key); in ceilingEntry()
182 K ceilingKey(K key); in ceilingKey()
197 Map.Entry<K,V> higherEntry(K key); in higherEntry()
211 K higherKey(K key); in higherKey()
220 Map.Entry<K,V> firstEntry(); in firstEntry()
[all …]
DTreeMap.java112 public class TreeMap<K,V>
113 extends AbstractMap<K,V>
114 implements NavigableMap<K,V>, Cloneable, java.io.Serializable
122 private final Comparator<? super K> comparator;
124 private transient TreeMapEntry<K,V> root = null;
166 public TreeMap(Comparator<? super K> comparator) { in TreeMap()
184 public TreeMap(Map<? extends K, ? extends V> m) { in TreeMap() argument
198 public TreeMap(SortedMap<K, ? extends V> m) { in TreeMap() argument
250 for (TreeMapEntry<K,V> e = getFirstEntry(); e != null; e = successor(e)) in containsValue()
279 TreeMapEntry<K,V> p = getEntry(key); in get()
[all …]
DSortedMap.java113 public interface SortedMap<K,V> extends Map<K,V> {
123 Comparator<? super K> comparator(); in comparator()
154 SortedMap<K,V> subMap(K fromKey, K toKey); in subMap()
181 SortedMap<K,V> headMap(K toKey); in headMap()
208 SortedMap<K,V> tailMap(K fromKey); in tailMap()
216 K firstKey(); in firstKey()
224 K lastKey(); in lastKey()
243 Set<K> keySet(); in keySet()
283 Set<Map.Entry<K, V>> entrySet(); in entrySet()
DAbstractMap.java68 public abstract class AbstractMap<K,V> implements Map<K,V> {
109 Iterator<Entry<K,V>> i = entrySet().iterator(); in containsValue()
112 Entry<K,V> e = i.next(); in containsValue()
118 Entry<K,V> e = i.next(); in containsValue()
140 Iterator<Map.Entry<K,V>> i = entrySet().iterator(); in containsKey()
143 Entry<K,V> e = i.next(); in containsKey()
149 Entry<K,V> e = i.next(); in containsKey()
171 Iterator<Entry<K,V>> i = entrySet().iterator(); in get()
174 Entry<K,V> e = i.next(); in get()
180 Entry<K,V> e = i.next(); in get()
[all …]
DLinkedHashMap.java166 public class LinkedHashMap<K,V>
167 extends HashMap<K,V>
168 implements Map<K,V>
176 private transient LinkedHashMapEntry<K,V> header;
230 public LinkedHashMap(Map<? extends K, ? extends V> m) { in LinkedHashMap() argument
272 for (LinkedHashMapEntry<K,V> e = header.after; e != header; e = e.after) { in transfer()
318 LinkedHashMapEntry<K,V> e = (LinkedHashMapEntry<K,V>)getEntry(key); in get()
337 private static class LinkedHashMapEntry<K,V> extends HashMapEntry<K,V> {
339 LinkedHashMapEntry<K,V> before, after;
341 LinkedHashMapEntry(int hash, K key, V value, HashMapEntry<K,V> next) { in LinkedHashMapEntry() argument
[all …]
DWeakHashMap.java135 public class WeakHashMap<K,V>
136 extends AbstractMap<K,V>
137 implements Map<K,V> {
159 Entry<K,V>[] table;
193 private Entry<K,V>[] newTable(int n) { in newTable()
194 return (Entry<K,V>[]) new Entry[n]; in newTable()
253 public WeakHashMap(Map<? extends K, ? extends V> m) { in WeakHashMap() argument
303 Entry<K,V> e = (Entry<K,V>) x; in expungeStaleEntries()
306 Entry<K,V> prev = table[i]; in expungeStaleEntries()
307 Entry<K,V> p = prev; in expungeStaleEntries()
[all …]
DMap.java130 public interface Map<K, V> {
242 V put(K key, V value); in put()
298 void putAll(Map<? extends K, ? extends V> m); in putAll() argument
327 Set<K> keySet(); in keySet()
362 Set<Map.Entry<K, V>> entrySet(); in entrySet()
377 interface Entry<K, V> {
386 K getKey(); in getKey()
472 … public static <K extends Comparable<? super K>, V> Comparator<Map.Entry<K, V>> comparingByKey() { in comparingByKey()
473 return (Comparator<Map.Entry<K, V>> & Serializable) in comparingByKey()
489 …public static <K, V extends Comparable<? super V>> Comparator<Map.Entry<K, V>> comparingByValue() { in comparingByValue()
[all …]
DHashMap.java129 public class HashMap<K,V>
130 extends AbstractMap<K,V>
131 implements Map<K,V>, Cloneable, Serializable
159 transient HashMapEntry<K,V>[] table = (HashMapEntry<K,V>[]) EMPTY_TABLE;
252 public HashMap(Map<? extends K, ? extends V> m) { in HashMap() argument
348 Entry<K,V> entry = getEntry(key); in get()
364 for (HashMapEntry<K,V> e = table[0]; e != null; e = e.next) { in getForNullKey()
388 final Entry<K,V> getEntry(Object key) { in getEntry()
394 for (HashMapEntry<K,V> e = table[indexFor(hash, table.length)]; in getEntry()
417 public V put(K key, V value) { in put()
[all …]
DHashtable.java130 public class Hashtable<K,V>
131 extends Dictionary<K,V>
132 implements Map<K,V>, Cloneable, java.io.Serializable {
137 private transient HashtableEntry<K,V>[] table;
227 public Hashtable(Map<? extends K, ? extends V> t) { in Hashtable() argument
260 public synchronized Enumeration<K> keys() { in keys()
261 return this.<K>getEnumeration(KEYS); in keys()
302 for (HashtableEntry<K,V> e = tab[i] ; e != null ; e = e.next) { in contains()
341 for (HashtableEntry<K,V> e = tab[index] ; e != null ; e = e.next) { in containsKey()
368 for (HashtableEntry<K,V> e = tab[index] ; e != null ; e = e.next) { in get()
[all …]
DEnumMap.java79 public class EnumMap<K extends Enum<K>, V> extends AbstractMap<K, V>
87 private final Class<K> keyType;
92 private transient K[] keyUniverse;
135 public EnumMap(Class<K> keyType) { in EnumMap()
148 public EnumMap(EnumMap<K, ? extends V> m) { in EnumMap() argument
167 public EnumMap(Map<K, ? extends V> m) { in EnumMap() argument
169 EnumMap<K, ? extends V> em = (EnumMap<K, ? extends V>) m; in EnumMap()
265 public V put(K key, V value) { in put()
332 public void putAll(Map<? extends K, ? extends V> m) { in putAll() argument
334 EnumMap<? extends K, ? extends V> em = in putAll()
[all …]
DCollections.java1416 public static <K,V> Map<K,V> unmodifiableMap(Map<? extends K, ? extends V> m) {
1423 private static class UnmodifiableMap<K,V> implements Map<K,V>, Serializable {
1426 private final Map<? extends K, ? extends V> m;
1428 UnmodifiableMap(Map<? extends K, ? extends V> m) {
1440 public V put(K key, V value) {
1446 public void putAll(Map<? extends K, ? extends V> m) {
1453 private transient Set<K> keySet = null;
1454 private transient Set<Map.Entry<K,V>> entrySet = null;
1457 public Set<K> keySet() {
1463 public Set<Map.Entry<K,V>> entrySet() {
[all …]
DIdentityHashMap.java139 public class IdentityHashMap<K,V>
140 extends AbstractMap<K,V>
141 implements Map<K,V>, java.io.Serializable, Cloneable
276 public IdentityHashMap(Map<? extends K, ? extends V> m) { in IdentityHashMap() argument
431 public V put(K key, V value) { in put()
503 public void putAll(Map<? extends K, ? extends V> m) { in putAll() argument
510 for (Entry<? extends K, ? extends V> e : m.entrySet()) in putAll()
828 private class KeyIterator extends IdentityHashMapIterator<K> {
830 public K next() { in next()
831 return (K) unmaskNull(traversalTable[nextIndex()]); in next()
[all …]
/libcore/luni/src/main/java/java/util/concurrent/
DConcurrentNavigableMap.java25 public interface ConcurrentNavigableMap<K,V>
26 extends ConcurrentMap<K,V>, NavigableMap<K,V>
33 ConcurrentNavigableMap<K,V> subMap(K fromKey, boolean fromInclusive, in subMap()
34 K toKey, boolean toInclusive); in subMap()
41 ConcurrentNavigableMap<K,V> headMap(K toKey, boolean inclusive); in headMap()
48 ConcurrentNavigableMap<K,V> tailMap(K fromKey, boolean inclusive); in tailMap()
55 ConcurrentNavigableMap<K,V> subMap(K fromKey, K toKey); in subMap()
62 ConcurrentNavigableMap<K,V> headMap(K toKey); in headMap()
69 ConcurrentNavigableMap<K,V> tailMap(K fromKey); in tailMap()
83 ConcurrentNavigableMap<K,V> descendingMap(); in descendingMap()
[all …]
DConcurrentSkipListMap.java86 public class ConcurrentSkipListMap<K,V> extends AbstractMap<K,V>
87 implements ConcurrentNavigableMap<K,V>, Cloneable, Serializable {
338 private transient volatile HeadIndex<K,V> head;
346 final Comparator<? super K> comparator;
349 private transient KeySet<K,V> keySet;
351 private transient EntrySet<K,V> entrySet;
353 private transient Values<K,V> values;
355 private transient ConcurrentNavigableMap<K,V> descendingMap;
367 head = new HeadIndex<K,V>(new Node<K,V>(null, BASE_HEADER, null), in initialize()
374 private boolean casHead(HeadIndex<K,V> cmp, HeadIndex<K,V> val) { in casHead() argument
[all …]
DConcurrentHashMap.java235 public class ConcurrentHashMap<K,V> extends AbstractMap<K,V>
236 implements ConcurrentMap<K,V>, Serializable {
596 static class Node<K,V> implements Map.Entry<K,V> {
598 final K key;
600 volatile Node<K,V> next;
602 Node(int hash, K key, V val, Node<K,V> next) { in Node() argument
609 public final K getKey() { return key; } in getKey()
631 Node<K,V> find(int h, Object k) { in find()
632 Node<K,V> e = this; in find()
635 K ek; in find()
[all …]
DConcurrentMap.java44 public interface ConcurrentMap<K,V> extends Map<K,V> {
83 default void forEach(BiConsumer<? super K, ? super V> action) { in forEach() argument
85 for (Map.Entry<K,V> entry : entrySet()) { in forEach()
86 K k; in forEach()
130 V putIfAbsent(K key, V value); in putIfAbsent()
193 boolean replace(K key, V oldValue, V newValue); in replace()
225 V replace(K key, V value); in replace()
258 default void replaceAll(BiFunction<? super K, ? super V, ? extends V> function) { in replaceAll() argument
298 default V computeIfAbsent(K key, in computeIfAbsent()
299 Function<? super K, ? extends V> mappingFunction) { in computeIfAbsent() argument
[all …]
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/
DRefSortedMap.java36 public class RefSortedMap<K, V> extends java.util.AbstractMap<K, V>
37 implements SortedMap<K, V>, Cloneable, Serializable {
41 private static final class MapEntry<K, V> implements Map.Entry<K, V> {
43 final K key;
46 MapEntry(K key, V value) { in MapEntry()
51 public K getKey() { in getKey()
85 transient ArrayList<MapEntry<K, V>> entries = new ArrayList<MapEntry<K, V>>();
88 private final Comparator<? super K> comparator;
90 class SubMap extends java.util.AbstractMap<K, V>
91 implements SortedMap<K, V>, Cloneable {
[all …]
/libcore/ojluni/src/main/java/sun/security/util/
DCache.java72 public abstract class Cache<K,V> {
91 public abstract void put(K key, V value); in put()
116 public abstract void accept(CacheVisitor<K,V> visitor); in accept() argument
122 public static <K,V> Cache<K,V> newSoftMemoryCache(int size) { in newSoftMemoryCache()
131 public static <K,V> Cache<K,V> newSoftMemoryCache(int size, int timeout) { in newSoftMemoryCache()
139 public static <K,V> Cache<K,V> newHardMemoryCache(int size) { in newHardMemoryCache()
147 public static <K,V> Cache<K,V> newNullCache() { in newNullCache()
148 return (Cache<K,V>) NullCache.INSTANCE; in newNullCache()
156 public static <K,V> Cache<K,V> newHardMemoryCache(int size, int timeout) { in newHardMemoryCache()
197 public interface CacheVisitor<K,V> {
[all …]
/libcore/ojluni/src/main/java/sun/util/locale/
DLocaleObjectCache.java39 public abstract class LocaleObjectCache<K, V> {
40 private ConcurrentMap<K, CacheEntry<K, V>> map;
51 public V get(K key) { in get()
55 CacheEntry<K, V> entry = map.get(key); in get()
67 CacheEntry<K, V> newEntry = new CacheEntry<>(key, newVal, queue); in get()
83 protected V put(K key, V value) { in put()
84 CacheEntry<K, V> entry = new CacheEntry<>(key, value, queue); in put()
85 CacheEntry<K, V> oldEntry = map.put(key, entry); in put()
91 CacheEntry<K, V> entry; in cleanStaleEntries()
92 while ((entry = (CacheEntry<K, V>)queue.poll()) != null) { in cleanStaleEntries()
[all …]
/libcore/luni/src/main/java/libcore/util/
DBasicLruCache.java26 public class BasicLruCache<K, V> {
27 private final LinkedHashMap<K, V> map;
35 this.map = new LinkedHashMap<K, V>(0, 0.75f, true); in BasicLruCache()
44 public final V get(K key) { in get()
82 public synchronized final V put(K key, V value) { in put()
96 Map.Entry<K, V> toEvict = map.eldest(); in trimToSize()
98 K key = toEvict.getKey(); in trimToSize()
110 protected void entryEvicted(K key, V value) {} in entryEvicted()
117 protected V create(K key) { in create()
125 public synchronized final Map<K, V> snapshot() { in snapshot()
[all …]
/libcore/ojluni/src/main/java/java/util/stream/
DAbstractTask.java88 K extends AbstractTask<P_IN, P_OUT, R, K>>
116 protected K leftChild;
123 protected K rightChild;
151 protected AbstractTask(K parent, in AbstractTask()
168 protected abstract K makeChild(Spliterator<P_IN> spliterator); in makeChild()
273 protected K getParent() { in getParent()
274 return (K) getCompleter(); in getParent()
296 @SuppressWarnings("unchecked") K task = (K) this; in compute()
298 K leftChild, rightChild, taskToFork; in compute()
343 K node = (K) this; in isLeftmostNode()
[all …]
DAbstractShortCircuitTask.java44 K extends AbstractShortCircuitTask<P_IN, P_OUT, R, K>>
45 extends AbstractTask<P_IN, P_OUT, R, K> {
81 protected AbstractShortCircuitTask(K parent, in AbstractShortCircuitTask()
106 @SuppressWarnings("unchecked") K task = (K) this; in compute()
118 K leftChild, rightChild, taskToFork; in compute()
209 for (K parent = getParent(); !cancel && parent != null; parent = parent.getParent()) in taskCanceled()
223 for (@SuppressWarnings("unchecked") K parent = getParent(), node = (K) this; in cancelLaterNodes()
228 K rightSibling = parent.rightChild; in cancelLaterNodes()
DCollectors.java316 private static <K, V, M extends Map<K,V>>
319 for (Map.Entry<K,V> e : m2.entrySet())
803 public static <T, K> Collector<T, ?, Map<K, List<T>>>
804 groupingBy(Function<? super T, ? extends K> classifier) {
850 public static <T, K, A, D>
851 Collector<T, ?, Map<K, D>> groupingBy(Function<? super T, ? extends K> classifier,
900 public static <T, K, D, A, M extends Map<K, D>>
901 Collector<T, ?, M> groupingBy(Function<? super T, ? extends K> classifier,
906 BiConsumer<Map<K, A>, T> accumulator = (m, t) -> {
907K key = Objects.requireNonNull(classifier.apply(t), "element cannot be mapped to a null key");
[all …]
/libcore/luni/src/test/java/libcore/java/util/
DConcurrentHashMapTest.java44 public void test_replace$K$V$V() { in test_replace$K$V$V()
46 .test_replace$K$V$V(new ConcurrentHashMap<>(), false /*doesNotAcceptNullKey*/, in test_replace$K$V$V()
50 public void test_replace$K$V() { in test_replace$K$V()
51 MapDefaultMethodTester.test_replace$K$V(new ConcurrentHashMap<>(), in test_replace$K$V()
/libcore/luni/src/test/java/libcore/java/util/concurrent/
DConcurrentSkipListMapTest.java46 public void test_replace$K$V$V() { in test_replace$K$V$V()
48 .test_replace$K$V$V(new ConcurrentSkipListMap<>(), false /*doesNotAcceptNullKey*/, in test_replace$K$V$V()
52 public void test_replace$K$V() { in test_replace$K$V()
53 MapDefaultMethodTester.test_replace$K$V(new ConcurrentSkipListMap<>(), in test_replace$K$V()

12