public Object next() { if (!hasNext()) throw new NoSuchElementException(); Entry e = lastReturned = entry; entry = e.getNext(); return type == KEYS ? e.getKey() : (type == VALUES ? e.getValue() : e); }
public Object next() { if (!hasNext()) throw new NoSuchElementException(); Entry e = lastReturned = entry; entry = e.getNext(); return type == KEYS ? e.getKey() : (type == VALUES ? e.getValue() : e); }
public Object next() { if (!hasNext()) throw new NoSuchElementException(); Entry e = lastReturned = entry; entry = e.getNext(); return type == KEYS ? e.getKey() : (type == VALUES ? e.getValue() : e); }
/** * 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 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; }
public Map.Entry removeRandom() { synchronized (this) { expungeStaleEntries(); if (count == 0) return null; int random = randomEntryIndex(); int index = findEntry(random, random % 2 == 0, false); if (index == -1) return null; Entry rem = table[index]; table[index] = rem.getNext(); count--; return rem; } }
public Map.Entry removeRandom() { synchronized (this) { expungeStaleEntries(); if (count == 0) return null; int random = randomEntryIndex(); int index = findEntry(random, random % 2 == 0, false); if (index == -1) return null; Entry rem = table[index]; table[index] = rem.getNext(); count--; return rem; } }
/** * 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 Map.Entry removeRandom() { synchronized (this) { expungeStaleEntries(); if (count == 0) return null; int random = randomEntryIndex(); int index = findEntry(random, random % 2 == 0, false); if (index == -1) return null; Entry rem = table[index]; table[index] = rem.getNext(); count--; return rem; } }
public Map.Entry removeRandom() { synchronized (this) { expungeStaleEntries(); if (count == 0) return null; int random = randomEntryIndex(); int index = findEntry(random, random % 2 == 0, false); if (index == -1) return null; Entry rem = table[index]; table[index] = rem.getNext(); count--; return rem; } }
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; }
public Object next() { if (!hasNext()) throw new NoSuchElementException(); Entry e = lastReturned = entry; entry = e.getNext(); return type == KEYS ? e.getKey() : (type == VALUES ? e.getValue() : e); }