/** * Returns the value to which this map maps the specified key. * Returns {@code null} if the map contains no mapping for this key. * Null keys are considered never present. * * @param key key whose associated value is to be returned. * @return the value to which this map maps the specified key. */ @Override @SuppressWarnings("unchecked") public synchronized V get(final Object key) { assert isValid(); if (key != null) { final Entry[] table = this.table; final int index = (keyHashCode(key) & HASH_MASK) % table.length; for (Entry e = table[index]; e != null; e = (Entry) e.next) { if (keyEquals(key, e.key)) { return e.get(); } } } return null; }
/** * Returns the value to which this map maps the specified key. * Returns {@code null} if the map contains no mapping for this key. * Null keys are considered never present. * * @param key key whose associated value is to be returned. * @return the value to which this map maps the specified key. */ @Override @SuppressWarnings("unchecked") public synchronized V get(final Object key) { assert isValid(); if (key != null) { final Entry[] table = this.table; final int index = (keyHashCode(key) & HASH_MASK) % table.length; for (Entry e = table[index]; e != null; e = (Entry) e.next) { if (keyEquals(key, e.key)) { return e.get(); } } } return null; }
final int hash = keyHashCode(key) & HASH_MASK; int index = hash % table.length; for (Entry e = table[index]; e != null; e = (Entry) e.next) {
final int hash = keyHashCode(key) & HASH_MASK; int index = hash % table.length; for (Entry e = table[index]; e != null; e = (Entry) e.next) {