@Test public void testEmpty() { Assert.assertTrue("found key in empty index", index.get("larsga") == null); }
@Override public E get(K key) { Entry entry = data[(key.hashCode() & 0x7FFFFFFF) % data.length]; while (entry != null && !entry.key.equals(key)) entry = entry.next; lookups++; if (entry == null) { E result = fallback.get(key); if (result == null && !nulls) return null; entry = addEntry(new Entry(key, result)); } else { hits++; entry.hits++; } return (E) entry.value; }
CachedIndex implements LookupIndexIF<K, E> { @Override public E get(K key) { Entry entry = data[(key.hashCode() & 0x7FFFFFFF) % data.length]; while (entry != null && !entry.key.equals(key)) entry = entry.next; lookups++; if (entry == null) { E result = fallback.get(key); if (result == null && !nulls) return null; entry = addEntry(new Entry(key, result)); } else { hits++; entry.hits++; } return (E) entry.value; } }
CachedIndex implements LookupIndexIF<K, E> { @Override public E get(K key) { Entry entry = data[(key.hashCode() & 0x7FFFFFFF) % data.length]; while (entry != null && !entry.key.equals(key)) entry = entry.next; lookups++; if (entry == null) { E result = fallback.get(key); if (result == null && !nulls) return null; entry = addEntry(new Entry(key, result)); } else { hits++; entry.hits++; } return (E) entry.value; } CachedIndex(LookupIndexIF<K, E> fallback);  CachedIndex(LookupIndexIF<K, E> fallback, boolean nulls);  CachedIndex(LookupIndexIF<K, E> fallback, int max, int size, boolean nulls); }
CachedIndex implements LookupIndexIF<K, E> { @Override public E get(K key) { Entry entry = data[(key.hashCode() & 0x7FFFFFFF) % data.length]; while (entry != null && !entry.key.equals(key)) entry = entry.next; lookups++; if (entry == null) { E result = fallback.get(key); if (result == null && !nulls) return null; entry = addEntry(new Entry(key, result)); } else { hits++; entry.hits++; } return (E) entry.value; } CachedIndex(LookupIndexIF<K, E> fallback);  CachedIndex(LookupIndexIF<K, E> fallback, boolean nulls);  CachedIndex(LookupIndexIF<K, E> fallback, int max, int size, boolean nulls); @Override E get(K key); @Override E put(K key, E value); @Override E remove(K key); int getKeyNumber(); void writeReport(); }
CachedIndex implements LookupIndexIF<K, E> { @Override public E get(K key) { Entry entry = data[(key.hashCode() & 0x7FFFFFFF) % data.length]; while (entry != null && !entry.key.equals(key)) entry = entry.next; lookups++; if (entry == null) { E result = fallback.get(key); if (result == null && !nulls) return null; entry = addEntry(new Entry(key, result)); } else { hits++; entry.hits++; } return (E) entry.value; } CachedIndex(LookupIndexIF<K, E> fallback);  CachedIndex(LookupIndexIF<K, E> fallback, boolean nulls);  CachedIndex(LookupIndexIF<K, E> fallback, int max, int size, boolean nulls); @Override E get(K key); @Override E put(K key, E value); @Override E remove(K key); int getKeyNumber(); void writeReport();  }