@Override public boolean containsValue(Object value) { return containsValue(((Float) value).floatValue()); }
K cur; keyAbsent: if ((cur = keys[index = SeparateKVObjKeyMixing.mix(keyHashCode(key)) & (capacityMask = keys.length - 1)]) != FREE) { if (cur == key || keyEquals(key, cur)) { if ((cur = keys[(index = (index - 1) & capacityMask)]) == FREE) { break keyAbsent; } else if (cur == key || (keyEquals(key, cur))) { incrementModCount(); keys[index] = key; values[index] = value; postInsertHook(); return -1; } else { return insertNullKey(value);
int valueIndex(int value) { if (isEmpty()) return -1; int index = -1; int mc = modCount(); Object[] keys = set; int[] vals = values; for (int i = keys.length - 1; i >= 0; i--) { if (keys[i] != FREE) { if (value == vals[i]) { index = i; break; } } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return index; }
int insertNullKey(int value) { // noinspection unchecked K[] keys = (K[]) set; int capacityMask, index; K cur; keyAbsent: if ((cur = keys[index = 0]) != FREE) { if (cur == null) { // key is present return index; } else { capacityMask = keys.length - 1; while (true) { if ((cur = keys[(index = (index - 1) & capacityMask)]) == FREE) { break keyAbsent; } else if (cur == null) { // key is present return index; } } } } // key is absent incrementModCount(); keys[index] = null; values[index] = value; postInsertHook(); return -1; }
@Override final void copy(SeparateKVObjFloatLHash hash) { int myMC = modCount(), hashMC = hash.modCount(); super.copy(hash); if (myMC != modCount() || hashMC != hash.modCount()) throw new ConcurrentModificationException(); }
@Override final void move(SeparateKVObjFloatLHash hash) { int myMC = modCount(), hashMC = hash.modCount(); super.move(hash); if (myMC != modCount() || hashMC != hash.modCount()) throw new ConcurrentModificationException(); }
@Override public void clear() { int mc = modCount() + 1; super.clear(); if (mc != modCount()) throw new ConcurrentModificationException(); }
int insertNullKey(int value) { // noinspection unchecked K[] keys = (K[]) set; int capacityMask, index; K cur; keyAbsent: if ((cur = keys[index = 0]) != FREE) { if (cur == null) { // key is present return index; } else { capacityMask = keys.length - 1; while (true) { if ((cur = keys[(index = (index - 1) & capacityMask)]) == FREE) { break keyAbsent; } else if (cur == null) { // key is present return index; } } } } // key is absent incrementModCount(); keys[index] = null; values[index] = value; postInsertHook(); return -1; }
@Override final void copy(SeparateKVObjFloatLHash hash) { int myMC = modCount(), hashMC = hash.modCount(); super.copy(hash); if (myMC != modCount() || hashMC != hash.modCount()) throw new ConcurrentModificationException(); }
@Override final void move(SeparateKVObjFloatLHash hash) { int myMC = modCount(), hashMC = hash.modCount(); super.move(hash); if (myMC != modCount() || hashMC != hash.modCount()) throw new ConcurrentModificationException(); }
@Override public void clear() { int mc = modCount() + 1; super.clear(); if (mc != modCount()) throw new ConcurrentModificationException(); }
K cur; keyAbsent: if ((cur = keys[index = SeparateKVObjKeyMixing.mix(keyHashCode(key)) & (capacityMask = keys.length - 1)]) != FREE) { if (cur == key || keyEquals(key, cur)) { if ((cur = keys[(index = (index - 1) & capacityMask)]) == FREE) { break keyAbsent; } else if (cur == key || (keyEquals(key, cur))) { incrementModCount(); keys[index] = key; values[index] = value; postInsertHook(); return -1; } else { return insertNullKey(value);
int valueIndex(int value) { if (isEmpty()) return -1; int index = -1; int mc = modCount(); Object[] keys = set; int[] vals = values; for (int i = keys.length - 1; i >= 0; i--) { if (keys[i] != FREE) { if (value == vals[i]) { index = i; break; } } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return index; }
@Override public boolean containsValue(Object value) { return containsValue(((Float) value).floatValue()); }
int valueIndex(float value) { if (isEmpty()) return -1; int val = Float.floatToIntBits(value); int index = -1; int mc = modCount(); Object[] keys = set; int[] vals = values; for (int i = keys.length - 1; i >= 0; i--) { if (keys[i] != FREE) { if (val == vals[i]) { index = i; break; } } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return index; }
int valueIndex(float value) { if (isEmpty()) return -1; int val = Float.floatToIntBits(value); int index = -1; int mc = modCount(); Object[] keys = set; int[] vals = values; for (int i = keys.length - 1; i >= 0; i--) { if (keys[i] != FREE) { if (val == vals[i]) { index = i; break; } } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return index; }