@Override public void clear() { UpdatableLHashSeparateKVShortFloatMapGO.this.clear(); } }
@Override @SuppressWarnings("unchecked") public boolean contains(Object o) { try { Map.Entry<Short, Float> e = (Map.Entry<Short, Float>) o; return containsEntry(e.getKey(), e.getValue()); } catch (NullPointerException e) { return false; } catch (ClassCastException e) { return false; } }
@Override public boolean contains(float v) { return UpdatableLHashSeparateKVShortFloatMapGO.this.containsValue(v); }
@Override public float get(short key) { int index = index(key); if (index >= 0) { // key is present return Float.intBitsToFloat(values[index]); } else { // key is absent return defaultValue(); } }
@Override public float putIfAbsent(short key, float value) { int index = insert(key, Float.floatToIntBits(value)); if (index < 0) { // key was absent return defaultValue(); } else { // key is present return Float.intBitsToFloat(values[index]); } }
short free; if (k == (free = freeValue)) { free = changeFree(); incrementModCount(); keys[index] = k; vals[index] = Float.floatToIntBits(value); postInsertHook(); return value; } else {
short free; if (key == (free = freeValue)) { free = changeFree(); float newValue = remappingFunction.applyAsFloat(key, defaultValue()); incrementModCount(); keys[index] = key; vals[index] = Float.floatToIntBits(newValue); postInsertHook(); return newValue;
@Override @Nonnull public UpdatableLHashSeparateKVShortFloatMapGO newUpdatableMap( Map<Short, Float> map) { if (map instanceof ShortFloatMap) { if (map instanceof SeparateKVShortFloatLHash) { SeparateKVShortFloatLHash hash = (SeparateKVShortFloatLHash) map; if (hash.hashConfig().equals(hashConf)) { UpdatableLHashSeparateKVShortFloatMapGO res = uninitializedUpdatableMap(); res.copy(hash); return res; } } UpdatableLHashSeparateKVShortFloatMapGO res = newUpdatableMap(map.size()); res.putAll(map); return res; } UpdatableLHashSeparateKVShortFloatMapGO res = newUpdatableMap(map.size()); for (Map.Entry<Short, Float> entry : map.entrySet()) { res.put(entry.getKey(), entry.getValue()); } return res; } }
@Nonnull @Override public HashConfig hashConfig() { return UpdatableLHashSeparateKVShortFloatMapGO.this.hashConfig(); }
@Override public double currentLoad() { return UpdatableLHashSeparateKVShortFloatMapGO.this.currentLoad(); }
public int hashCode() { return UpdatableLHashSeparateKVShortFloatMapGO.this.hashCode(); }
short free; if (key == (free = freeValue)) { free = changeFree(); incrementModCount(); keys[index] = key; vals[index] = Float.floatToIntBits(value); postInsertHook(); return value;
short free; if (key == (free = freeValue)) { free = changeFree(); float newValue = remappingFunction.applyAsFloat(key, defaultValue()); incrementModCount(); keys[index] = key; vals[index] = Float.floatToIntBits(newValue); postInsertHook(); return newValue;
@Override public float get(short key) { int index = index(key); if (index >= 0) { // key is present return Float.intBitsToFloat(values[index]); } else { // key is absent return defaultValue(); } }
@Override @Nonnull public UpdatableLHashSeparateKVShortFloatMapGO newUpdatableMap( Map<Short, Float> map) { if (map instanceof ShortFloatMap) { if (map instanceof SeparateKVShortFloatLHash) { SeparateKVShortFloatLHash hash = (SeparateKVShortFloatLHash) map; if (hash.hashConfig().equals(hashConf)) { UpdatableLHashSeparateKVShortFloatMapGO res = uninitializedUpdatableMap(); res.copy(hash); return res; } } UpdatableLHashSeparateKVShortFloatMapGO res = newUpdatableMap(map.size()); res.putAll(map); return res; } UpdatableLHashSeparateKVShortFloatMapGO res = newUpdatableMap(map.size()); for (Map.Entry<Short, Float> entry : map.entrySet()) { res.put(entry.getKey(), entry.getValue()); } return res; } }
@Override public float putIfAbsent(short key, float value) { int index = insert(key, Float.floatToIntBits(value)); if (index < 0) { // key was absent return defaultValue(); } else { // key is present return Float.intBitsToFloat(values[index]); } }
@Nonnull @Override public HashConfig hashConfig() { return UpdatableLHashSeparateKVShortFloatMapGO.this.hashConfig(); }
@Override public double currentLoad() { return UpdatableLHashSeparateKVShortFloatMapGO.this.currentLoad(); }
public int hashCode() { return UpdatableLHashSeparateKVShortFloatMapGO.this.hashCode(); }
short free; if (key == (free = freeValue)) { free = changeFree(); incrementModCount(); keys[index] = key; vals[index] = Float.floatToIntBits(value); postInsertHook(); return value;