/** * Returns this map's entry that has the same key and value as {@code * entry}, or null if this map has no such entry. * * <p>This method uses the comparator for key equality rather than {@code * equals}. If this map's comparator isn't consistent with equals (such as * {@code String.CASE_INSENSITIVE_ORDER}), then {@code remove()} and {@code * contains()} will violate the collections API. */ Node<K, V> findByEntry(Entry<?, ?> entry) { Node<K, V> mine = findByObject(entry.getKey()); boolean valuesEqual = mine != null && equal(mine.value, entry.getValue()); return valuesEqual ? mine : null; }
/** * Returns this map's entry that has the same key and value as {@code * entry}, or null if this map has no such entry. * * <p>This method uses the comparator for key equality rather than {@code * equals}. If this map's comparator isn't consistent with equals (such as * {@code String.CASE_INSENSITIVE_ORDER}), then {@code remove()} and {@code * contains()} will violate the collections API. */ Node<K, V> findByEntry(Entry<?, ?> entry) { Node<K, V> mine = findByObject(entry.getKey()); boolean valuesEqual = mine != null && equal(mine.value, entry.getValue()); return valuesEqual ? mine : null; }
/** * Returns this map's entry that has the same key and value as {@code * entry}, or null if this map has no such entry. * * <p>This method uses the comparator for key equality rather than {@code * equals}. If this map's comparator isn't consistent with equals (such as * {@code String.CASE_INSENSITIVE_ORDER}), then {@code remove()} and {@code * contains()} will violate the collections API. */ Node<K, V> findByEntry(Entry<?, ?> entry) { Node<K, V> mine = findByObject(entry.getKey()); boolean valuesEqual = mine != null && equal(mine.value, entry.getValue()); return valuesEqual ? mine : null; }
/** * Returns this map's entry that has the same key and value as {@code * entry}, or null if this map has no such entry. * * <p>This method uses the comparator for key equality rather than {@code * equals}. If this map's comparator isn't consistent with equals (such as * {@code String.CASE_INSENSITIVE_ORDER}), then {@code remove()} and {@code * contains()} will violate the collections API. */ Node<K, V> findByEntry(Entry<?, ?> entry) { Node<K, V> mine = findByObject(entry.getKey()); boolean valuesEqual = mine != null && equal(mine.value, entry.getValue()); return valuesEqual ? mine : null; }
/** * Returns this map's entry that has the same key and value as {@code * entry}, or null if this map has no such entry. * * <p>This method uses the comparator for key equality rather than {@code * equals}. If this map's comparator isn't consistent with equals (such as * {@code String.CASE_INSENSITIVE_ORDER}), then {@code remove()} and {@code * contains()} will violate the collections API. */ Node<K, V> findByEntry(Entry<?, ?> entry) { Node<K, V> mine = findByObject(entry.getKey()); boolean valuesEqual = mine != null && equal(mine.value, entry.getValue()); return valuesEqual ? mine : null; }