/** * Get the value for the given key if the entry is cached. This method does * not modify the internal state. * * @param key the key (may not be null) * @return the value, or null if there is no resident entry */ public V peek(long key) { Entry<V> e = find(key); return e == null ? null : e.value; }
/** * Get the entry set for all resident entries. * * @return the entry set */ public synchronized Set<Map.Entry<Long, V>> entrySet() { HashMap<Long, V> map = new HashMap<>(); for (long k : keySet()) { map.put(k, find(k).value); } return map.entrySet(); }
/** * Get the values for all resident entries. * * @return the entry set */ public List<V> values() { ArrayList<V> list = new ArrayList<>(); for (long k : keySet()) { V value = find(k).value; if (value != null) { list.add(value); } } return list; }
/** * Convert this cache to a map. * * @return the map */ public Map<Long, V> getMap() { HashMap<Long, V> map = new HashMap<>(); for (long k : keySet()) { V x = find(k).value; if (x != null) { map.put(k, x); } } return map; }
/** * Get the value for the given key if the entry is cached. This method does * not modify the internal state. * * @param key the key (may not be null) * @return the value, or null if there is no resident entry */ public V peek(long key) { Entry<V> e = find(key); return e == null ? null : e.value; }
/** * Get the value for the given key if the entry is cached. This method does * not modify the internal state. * * @param key the key (may not be null) * @return the value, or null if there is no resident entry */ public V peek(long key) { Entry<V> e = find(key); return e == null ? null : e.value; }
/** * Get the value for the given key if the entry is cached. This method does * not modify the internal state. * * @param key the key (may not be null) * @return the value, or null if there is no resident entry */ public V peek(long key) { Entry<V> e = find(key); return e == null ? null : e.value; }
/** * Get the entry set for all resident entries. * * @return the entry set */ public synchronized Set<Map.Entry<Long, V>> entrySet() { HashMap<Long, V> map = new HashMap<Long, V>(); for (long k : keySet()) { map.put(k, find(k).value); } return map.entrySet(); }
/** * Get the entry set for all resident entries. * * @return the entry set */ public synchronized Set<Map.Entry<Long, V>> entrySet() { HashMap<Long, V> map = new HashMap<>(); for (long k : keySet()) { map.put(k, find(k).value); } return map.entrySet(); }
/** * Get the entry set for all resident entries. * * @return the entry set */ public synchronized Set<Map.Entry<Long, V>> entrySet() { HashMap<Long, V> map = new HashMap<Long, V>(); for (long k : keySet()) { map.put(k, find(k).value); } return map.entrySet(); }
/** * Convert this cache to a map. * * @return the map */ public Map<Long, V> getMap() { HashMap<Long, V> map = new HashMap<Long, V>(); for (long k : keySet()) { V x = find(k).value; if (x != null) { map.put(k, x); } } return map; }
/** * Convert this cache to a map. * * @return the map */ public Map<Long, V> getMap() { HashMap<Long, V> map = new HashMap<Long, V>(); for (long k : keySet()) { V x = find(k).value; if (x != null) { map.put(k, x); } } return map; }
/** * Get the values for all resident entries. * * @return the entry set */ public List<V> values() { ArrayList<V> list = new ArrayList<>(); for (long k : keySet()) { V value = find(k).value; if (value != null) { list.add(value); } } return list; }
/** * Get the values for all resident entries. * * @return the entry set */ public List<V> values() { ArrayList<V> list = new ArrayList<V>(); for (long k : keySet()) { V value = find(k).value; if (value != null) { list.add(value); } } return list; }
/** * Convert this cache to a map. * * @return the map */ public Map<Long, V> getMap() { HashMap<Long, V> map = new HashMap<>(); for (long k : keySet()) { V x = find(k).value; if (x != null) { map.put(k, x); } } return map; }
/** * Get the values for all resident entries. * * @return the entry set */ public List<V> values() { ArrayList<V> list = new ArrayList<V>(); for (long k : keySet()) { V value = find(k).value; if (value != null) { list.add(value); } } return list; }