private void reset() { InternalJsMapFactory factory = GWT.create(InternalJsMapFactory.class); hashCodeMap = factory.createJsHashCodeMap(); hashCodeMap.host = this; stringMap = factory.createJsStringMap(); stringMap.host = this; size = 0; structureChanged(this); }
/** * Removes the pair whose key is Object equal to <code>key</code> from <code>hashCodeMap</code>, * provided that <code>key</code>'s hash code is <code>hashCode</code>. Returns the value that was * associated with the removed key, or null if no such key existed. */ private V removeHashValue(Object key) { return hashCodeMap.remove(key); }
/** * Sets the specified key to the specified value in the hashCodeMap. Returns the value previously * at that key. Returns <code>null</code> if the specified key did not exist. */ private V putHashValue(K key, V value) { return hashCodeMap.put(key, value); }
/** * Returns true if the a key exists in the hashCodeMap that is Object equal to <code>key</code>, * provided that <code>key</code>'s hash code is <code>hashCode</code>. */ private boolean hasHashValue(Object key) { return hashCodeMap.getEntry(key) != null; }
/** * Returns the Map.Entry whose key is Object equal to <code>key</code>, provided that <code>key * </code>'s hash code is <code>hashCode</code>; or <code>null</code> if no such Map.Entry exists * at the specified hashCode. */ private V getHashValue(Object key) { return getEntryValueOrNull(hashCodeMap.getEntry(key)); }
@Override public boolean containsValue(Object value) { return stringMap.containsValue(value) || hashCodeMap.containsValue(value); }