@Test public void cacheIterator() { final ObjectCache<String, String> cache = new ObjectCache<>(4); cache.put("Eclipse", "An IDE"); cache.put("IDEA", "good IDEA"); cache.put("IDEA 4.5", "better IDEA"); cache.put("IDEA 5.0", "perfect IDEA"); cache.put("IDEA 6.0", "IDEAL"); HashSet<String> values = new HashSet<>(); final Iterator<String> it = cache.values(); while (it.hasNext()) { values.add(it.next()); } Assert.assertNull(cache.get("Eclipse")); Assert.assertFalse(values.contains("An IDE")); Assert.assertTrue(values.contains("good IDEA")); Assert.assertTrue(values.contains("better IDEA")); Assert.assertTrue(values.contains("perfect IDEA")); Assert.assertTrue(values.contains("IDEAL")); }
public Iterator<V> values() { return new ObjectCacheValuesIterator<>(this); }
ObjectCache extends ObjectCacheBase<K, V> { public Iterator<V> values() { return new ObjectCacheValuesIterator<>(this); } }
ObjectCache extends ObjectCacheBase<K, V> { public Iterator<V> values() { return new ObjectCacheValuesIterator<>(this); } ObjectCache();  ObjectCache(int cacheSize);  ObjectCache(final int cacheSize, float secondGenSizeRatio); }
ObjectCache extends ObjectCacheBase<K, V> { public Iterator<V> values() { return new ObjectCacheValuesIterator<>(this); } ObjectCache();  ObjectCache(int cacheSize);  ObjectCache(final int cacheSize, float secondGenSizeRatio); void clear(); @Override void lock(); @Override void unlock(); @Override V remove(@NotNull final K key); void removeAll(); @Override V cacheObject(@NotNull final K key, @NotNull final V x); @Override V tryKey(@NotNull final K key); @Override V getObject(@NotNull final K key); @Override int count(); Iterator<K> keys(); Iterator<V> values(); void addDeletedPairsListener(final DeletedPairsListener<K, V> listener); void removeDeletedPairsListener(final DeletedPairsListener<K, V> listener); }
ObjectCache extends ObjectCacheBase<K, V> { public Iterator<V> values() { return new ObjectCacheValuesIterator<>(this); } ObjectCache();  ObjectCache(int cacheSize);  ObjectCache(final int cacheSize, float secondGenSizeRatio); void clear(); @Override void lock(); @Override void unlock(); @Override V remove(@NotNull final K key); void removeAll(); @Override V cacheObject(@NotNull final K key, @NotNull final V x); @Override V tryKey(@NotNull final K key); @Override V getObject(@NotNull final K key); @Override int count(); Iterator<K> keys(); Iterator<V> values(); void addDeletedPairsListener(final DeletedPairsListener<K, V> listener); void removeDeletedPairsListener(final DeletedPairsListener<K, V> listener); static final float DEFAULT_SECOND_GENERATION_QUEUE_SIZE_RATIO; }