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 specified key from the stringMap and returns the value that was previously there. * Returns <code>null</code> if the specified key does not exist. */ private V removeStringValue(String key) { return key == null ? removeHashValue(null) : stringMap.remove(key); }
/** * Sets the specified key to the specified value in the stringMap. Returns the value previously at * that key. Returns <code>null</code> if the specified key did not exist. */ private V putStringValue(String key, V value) { return key == null ? putHashValue(null, value) : stringMap.put(key, value); }
/** Returns true if the given key exists in the stringMap. */ private boolean hasStringValue(String key) { return key == null ? hasHashValue(null) : stringMap.contains(key); }
/** * Returns the value for the given key in the stringMap. Returns <code>null</code> if the * specified key does not exist. */ private V getStringValue(String key) { return key == null ? getHashValue(null) : stringMap.get(key); }
@Override public boolean containsValue(Object value) { return stringMap.containsValue(value) || hashCodeMap.containsValue(value); }