public void remove() { if (lastReturned == null) throw new IllegalStateException(); synchronized (ConcurrentReferenceHashMap.this) { Entry[] tab = ConcurrentReferenceHashMap.this.table; int index = (lastReturned.getHash() & 0x7FFFFFFF) % tab.length; for (Entry e = tab[index], prev = null; e != null; prev = e, e = e.getNext()) { if (e == lastReturned) { if (prev == null) tab[index] = e.getNext(); else prev.setNext(e.getNext()); count--; lastReturned = null; return; } } throw new Error("Iterated off table when doing remove"); } } }
public void remove() { if (lastReturned == null) throw new IllegalStateException(); synchronized (ConcurrentReferenceHashMap.this) { Entry[] tab = ConcurrentReferenceHashMap.this.table; int index = (lastReturned.getHash() & 0x7FFFFFFF) % tab.length; for (Entry e = tab[index], prev = null; e != null; prev = e, e = e.getNext()) { if (e == lastReturned) { if (prev == null) tab[index] = e.getNext(); else prev.setNext(e.getNext()); count--; lastReturned = null; return; } } throw new Error("Iterated off table when doing remove"); } } }
public void remove() { if (lastReturned == null) throw new IllegalStateException(); synchronized (ConcurrentReferenceHashMap.this) { Entry[] tab = ConcurrentReferenceHashMap.this.table; int index = (lastReturned.getHash() & 0x7FFFFFFF) % tab.length; for (Entry e = tab[index], prev = null; e != null; prev = e, e = e.getNext()) { if (e == lastReturned) { if (prev == null) tab[index] = e.getNext(); else prev.setNext(e.getNext()); count--; lastReturned = null; return; } } throw new Error("Iterated off table when doing remove"); } } }
public boolean remove(Object o) { if (!(o instanceof Map.Entry)) return false; Map.Entry entry = (Map.Entry) o; Object key = entry.getKey(); synchronized (ConcurrentReferenceHashMap.this) { Entry[] tab = table; int hash = hc(key); int index = (hash & 0x7FFFFFFF) % tab.length; for (Entry e = tab[index], prev = null; e != null; prev = e, e = e.getNext()) { if (e.getHash() == hash && eq(e, entry)) { if (prev != null) prev.setNext(e.getNext()); else tab[index] = e.getNext(); count--; return true; } } return false; } }
public boolean remove(Object o) { if (!(o instanceof Map.Entry)) return false; Map.Entry entry = (Map.Entry) o; Object key = entry.getKey(); synchronized (ConcurrentReferenceHashMap.this) { Entry[] tab = table; int hash = hc(key); int index = (hash & 0x7FFFFFFF) % tab.length; for (Entry e = tab[index], prev = null; e != null; prev = e, e = e.getNext()) { if (e.getHash() == hash && eq(e, entry)) { if (prev != null) prev.setNext(e.getNext()); else tab[index] = e.getNext(); count--; return true; } } return false; } }
public boolean remove(Object o) { if (!(o instanceof Map.Entry)) return false; Map.Entry entry = (Map.Entry) o; Object key = entry.getKey(); synchronized (ConcurrentReferenceHashMap.this) { Entry[] tab = table; int hash = hc(key); int index = (hash & 0x7FFFFFFF) % tab.length; for (Entry e = tab[index], prev = null; e != null; prev = e, e = e.getNext()) { if (e.getHash() == hash && eq(e, entry)) { if (prev != null) prev.setNext(e.getNext()); else tab[index] = e.getNext(); count--; return true; } } return false; } }
public boolean remove(Object o) { if (!(o instanceof Map.Entry)) return false; Map.Entry entry = (Map.Entry) o; Object key = entry.getKey(); synchronized (ConcurrentReferenceHashMap.this) { Entry[] tab = table; int hash = hc(key); int index = (hash & 0x7FFFFFFF) % tab.length; for (Entry e = tab[index], prev = null; e != null; prev = e, e = e.getNext()) { if (e.getHash() == hash && eq(e, entry)) { if (prev != null) prev.setNext(e.getNext()); else tab[index] = e.getNext(); count--; return true; } } return false; } }
public void remove() { if (lastReturned == null) throw new IllegalStateException(); synchronized (ConcurrentReferenceHashMap.this) { Entry[] tab = ConcurrentReferenceHashMap.this.table; int index = (lastReturned.getHash() & 0x7FFFFFFF) % tab.length; for (Entry e = tab[index], prev = null; e != null; prev = e, e = e.getNext()) { if (e == lastReturned) { if (prev == null) tab[index] = e.getNext(); else prev.setNext(e.getNext()); count--; lastReturned = null; return; } } throw new Error("Iterated off table when doing remove"); } } }
/** * Returns the value to which this HashMap maps the specified key. * Returns null if the HashMap contains no mapping for this key. * * @param key key whose associated value is to be returned. */ public Object get(Object key) { if (key == null && keyType != HARD) return null; Entry[] tab = table; int hash = hc(key); int index = (hash & 0x7FFFFFFF) % tab.length; for (Entry e = tab[index]; e != null; e = e.getNext()) if ((e.getHash() == hash) && eq(key, e.getKey())) return e.getValue(); return null; }
/** * Returns true if this HashMap contains a mapping for the specified key. * * @param key key whose presence in this Map is to be tested. */ public boolean containsKey(Object key) { if (key == null && keyType != HARD) return false; Entry[] tab = table; int hash = hc(key); int index = (hash & 0x7FFFFFFF) % tab.length; for (Entry e = tab[index]; e != null; e = e.getNext()) if (e.getHash() == hash && eq(key, e.getKey())) return true; return false; }
/** * Returns the value to which this HashMap maps the specified key. * Returns null if the HashMap contains no mapping for this key. * * @param key key whose associated value is to be returned. */ public Object get(Object key) { if (key == null && keyType != HARD) return null; Entry[] tab = table; int hash = hc(key); int index = (hash & 0x7FFFFFFF) % tab.length; for (Entry e = tab[index]; e != null; e = e.getNext()) if ((e.getHash() == hash) && eq(key, e.getKey())) return e.getValue(); return null; }
/** * Returns the value to which this HashMap maps the specified key. * Returns null if the HashMap contains no mapping for this key. * * @param key key whose associated value is to be returned. */ public Object get(Object key) { if (key == null && keyType != HARD) return null; Entry[] tab = table; int hash = hc(key); int index = (hash & 0x7FFFFFFF) % tab.length; for (Entry e = tab[index]; e != null; e = e.getNext()) if ((e.getHash() == hash) && eq(key, e.getKey())) return e.getValue(); return null; }
/** * Returns the value to which this HashMap maps the specified key. * Returns null if the HashMap contains no mapping for this key. * * @param key key whose associated value is to be returned. */ public Object get(Object key) { if (key == null && keyType != HARD) return null; Entry[] tab = table; int hash = hc(key); int index = (hash & 0x7FFFFFFF) % tab.length; for (Entry e = tab[index]; e != null; e = e.getNext()) if ((e.getHash() == hash) && eq(key, e.getKey())) return e.getValue(); return null; }
/** * Returns true if this HashMap contains a mapping for the specified key. * * @param key key whose presence in this Map is to be tested. */ public boolean containsKey(Object key) { if (key == null && keyType != HARD) return false; Entry[] tab = table; int hash = hc(key); int index = (hash & 0x7FFFFFFF) % tab.length; for (Entry e = tab[index]; e != null; e = e.getNext()) if (e.getHash() == hash && eq(key, e.getKey())) return true; return false; }
/** * Returns true if this HashMap contains a mapping for the specified key. * * @param key key whose presence in this Map is to be tested. */ public boolean containsKey(Object key) { if (key == null && keyType != HARD) return false; Entry[] tab = table; int hash = hc(key); int index = (hash & 0x7FFFFFFF) % tab.length; for (Entry e = tab[index]; e != null; e = e.getNext()) if (e.getHash() == hash && eq(key, e.getKey())) return true; return false; }
/** * Returns true if this HashMap contains a mapping for the specified key. * * @param key key whose presence in this Map is to be tested. */ public boolean containsKey(Object key) { if (key == null && keyType != HARD) return false; Entry[] tab = table; int hash = hc(key); int index = (hash & 0x7FFFFFFF) % tab.length; for (Entry e = tab[index]; e != null; e = e.getNext()) if (e.getHash() == hash && eq(key, e.getKey())) return true; return false; }
public boolean contains(Object o) { if (!(o instanceof Map.Entry)) return false; Map.Entry entry = (Map.Entry) o; Object key = entry.getKey(); Entry[] tab = table; int hash = hc(key); int index = (hash & 0x7FFFFFFF) % tab.length; for (Entry e = tab[index]; e != null; e = e.getNext()) if (e.getHash() == hash && eq(e, entry)) return true; return false; }
public boolean contains(Object o) { if (!(o instanceof Map.Entry)) return false; Map.Entry entry = (Map.Entry) o; Object key = entry.getKey(); Entry[] tab = table; int hash = hc(key); int index = (hash & 0x7FFFFFFF) % tab.length; for (Entry e = tab[index]; e != null; e = e.getNext()) if (e.getHash() == hash && eq(e, entry)) return true; return false; }
public boolean contains(Object o) { if (!(o instanceof Map.Entry)) return false; Map.Entry entry = (Map.Entry) o; Object key = entry.getKey(); Entry[] tab = table; int hash = hc(key); int index = (hash & 0x7FFFFFFF) % tab.length; for (Entry e = tab[index]; e != null; e = e.getNext()) if (e.getHash() == hash && eq(e, entry)) return true; return false; }
public boolean contains(Object o) { if (!(o instanceof Map.Entry)) return false; Map.Entry entry = (Map.Entry) o; Object key = entry.getKey(); Entry[] tab = table; int hash = hc(key); int index = (hash & 0x7FFFFFFF) % tab.length; for (Entry e = tab[index]; e != null; e = e.getNext()) if (e.getHash() == hash && eq(e, entry)) return true; return false; }