public boolean contains(Object o) { if (!(o instanceof Map.Entry)) return false; Map.Entry e = (Map.Entry) o; Entry candidate = getEntry(e.getKey()); return candidate != null && candidate.equals(e); }
public boolean contains(Object o) { if (!(o instanceof Map.Entry)) return false; Map.Entry e = (Map.Entry) o; Entry candidate = getEntry(e.getKey()); return candidate != null && candidate.equals(e); }
public boolean contains(Object o) { if (!(o instanceof Map.Entry)) return false; Map.Entry e = (Map.Entry) o; Entry candidate = getEntry(e.getKey()); return candidate != null && candidate.equals(e); }
/** * Special version of remove for EntrySet. */ private Entry removeMapping(Object o) { if (!(o instanceof Map.Entry)) return null; Map.Entry entry = (Map.Entry) o; Object k = maskNull(entry.getKey()); int hash = hash(k); synchronized (this) { int i = hash & (table.length - 1); Entry e = table[i]; if (e == null) return null; if (e.hash == hash && e.equals(entry)) { size--; table[i] = e.next; return e; } Entry prev = e; for (e = e.next; e != null; prev = e, e = e.next) { if (e.hash == hash && e.equals(entry)) { size--; prev.next = e.next; return e; } } } return null; }
/** * Special version of remove for EntrySet. */ private Entry removeMapping(Object o) { if (!(o instanceof Map.Entry)) return null; Map.Entry entry = (Map.Entry) o; Object k = maskNull(entry.getKey()); int hash = hash(k); synchronized (this) { int i = hash & (table.length - 1); Entry e = table[i]; if (e == null) return null; if (e.hash == hash && e.equals(entry)) { size--; table[i] = e.next; return e; } Entry prev = e; for (e = e.next; e != null; prev = e, e = e.next) { if (e.hash == hash && e.equals(entry)) { size--; prev.next = e.next; return e; } } } return null; }
/** * Special version of remove for EntrySet. */ private Entry removeMapping(Object o) { if (!(o instanceof Map.Entry)) return null; Map.Entry entry = (Map.Entry) o; Object k = maskNull(entry.getKey()); int hash = hash(k); synchronized (this) { int i = hash & (table.length - 1); Entry e = table[i]; if (e == null) return null; if (e.hash == hash && e.equals(entry)) { size--; table[i] = e.next; return e; } Entry prev = e; for (e = e.next; e != null; prev = e, e = e.next) { if (e.hash == hash && e.equals(entry)) { size--; prev.next = e.next; return e; } } } return null; }