public boolean allContainingIn(FloatCollection c) { if (c instanceof InternalFloatCollectionOps) return allContainingIn((InternalFloatCollectionOps) c); if (this.isEmpty()) return true; boolean containsAll = true; int mc = modCount(); int[] keys = set; for (int i = keys.length - 1; i >= 0; i--) { int key; if ((key = keys[i]) < FREE_BITS) { if (!c.contains(Float.intBitsToFloat(key))) { containsAll = false; break; } } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return containsAll; }
boolean retainAll(@Nonnull HashFloatSet thisC, @Nonnull Collection<?> c) { if (c instanceof FloatCollection) return retainAll(thisC, (FloatCollection) c); if (thisC == (Object) c) throw new IllegalArgumentException(); if (this.isEmpty()) return false; if (c.isEmpty()) { clear(); return true; } boolean changed = false; int mc = modCount(); int[] keys = set; for (int i = keys.length - 1; i >= 0; i--) { int key; if ((key = keys[i]) < FREE_BITS) { if (!c.contains(Float.intBitsToFloat(key))) { incrementModCount(); mc++; keys[i] = REMOVED_BITS; postRemoveHook(); changed = true; } } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return changed; }
@Override public void remove() { if (curKey != FREE_BITS) { if (expectedModCount++ == modCount()) { this.curKey = FREE_BITS; incrementModCount(); keys[index] = REMOVED_BITS; postRemoveHook(); } else { throw new java.util.ConcurrentModificationException(); } } else { throw new java.lang.IllegalStateException(); } } }
boolean reverseAddAllTo(InternalFloatCollectionOps c) { if (this.isEmpty()) return false; boolean changed = false; int mc = modCount(); int[] keys = set; for (int i = keys.length - 1; i >= 0; i--) { int key; if ((key = keys[i]) < FREE_BITS) { changed |= c.add(key); } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return changed; }
public boolean removeIf(Predicate<? super Float> filter) { if (filter == null) throw new java.lang.NullPointerException(); if (this.isEmpty()) return false; boolean changed = false; int mc = modCount(); int[] keys = set; for (int i = keys.length - 1; i >= 0; i--) { int key; if ((key = keys[i]) < FREE_BITS) { if (filter.test(Float.intBitsToFloat(key))) { incrementModCount(); mc++; keys[i] = REMOVED_BITS; postRemoveHook(); changed = true; } } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return changed; }
@Nonnull public Object[] toArray() { int size = size(); Object[] result = new Object[size]; if (size == 0) return result; int resultIndex = 0; int mc = modCount(); int[] keys = set; for (int i = keys.length - 1; i >= 0; i--) { int key; if ((key = keys[i]) < FREE_BITS) { result[resultIndex++] = Float.intBitsToFloat(key); } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return result; }
public boolean reverseAddAllTo(FloatCollection c) { if (c instanceof InternalFloatCollectionOps) return reverseAddAllTo((InternalFloatCollectionOps) c); if (this.isEmpty()) return false; boolean changed = false; int mc = modCount(); int[] keys = set; for (int i = keys.length - 1; i >= 0; i--) { int key; if ((key = keys[i]) < FREE_BITS) { changed |= c.add(Float.intBitsToFloat(key)); } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return changed; }
public boolean reverseRemoveAllFrom(FloatSet s) { if (s instanceof InternalFloatCollectionOps) return reverseRemoveAllFrom((InternalFloatCollectionOps) s); if (this.isEmpty() || s.isEmpty()) return false; boolean changed = false; int mc = modCount(); int[] keys = set; for (int i = keys.length - 1; i >= 0; i--) { int key; if ((key = keys[i]) < FREE_BITS) { changed |= s.removeFloat(Float.intBitsToFloat(key)); } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return changed; }
public String setToString() { if (this.isEmpty()) return "[]"; StringBuilder sb = new StringBuilder(); int elementCount = 0; int mc = modCount(); int[] keys = set; for (int i = keys.length - 1; i >= 0; i--) { int key; if ((key = keys[i]) < FREE_BITS) { sb.append(' ').append(Float.intBitsToFloat(key)).append(','); if (++elementCount == 8) { int expectedLength = sb.length() * (size() / 8); sb.ensureCapacity(expectedLength + (expectedLength / 2)); } } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); sb.setCharAt(0, '['); sb.setCharAt(sb.length() - 1, ']'); return sb.toString(); }
@Override void removeAt(int index) { incrementModCount(); super.removeAt(index); postRemoveHook(); }
@Override public void clear() { int mc = modCount() + 1; super.clear(); if (mc != modCount()) throw new ConcurrentModificationException(); } }
@Override public void remove() { int index; if ((index = this.index) >= 0) { if (expectedModCount++ == modCount()) { this.index = -1; incrementModCount(); keys[index] = REMOVED_BITS; postRemoveHook(); } else { throw new java.util.ConcurrentModificationException(); } } else { throw new java.lang.IllegalStateException(); } } }
public void forEach(Consumer<? super Float> action) { if (action == null) throw new java.lang.NullPointerException(); if (this.isEmpty()) return; int mc = modCount(); int[] keys = set; for (int i = keys.length - 1; i >= 0; i--) { int key; if ((key = keys[i]) < FREE_BITS) { action.accept(Float.intBitsToFloat(key)); } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); }
@Nonnull public float[] toFloatArray() { int size = size(); float[] result = new float[size]; if (size == 0) return result; int resultIndex = 0; int mc = modCount(); int[] keys = set; for (int i = keys.length - 1; i >= 0; i--) { int key; if ((key = keys[i]) < FREE_BITS) { result[resultIndex++] = Float.intBitsToFloat(key); } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return result; }
public boolean reverseAddAllTo(FloatCollection c) { if (c instanceof InternalFloatCollectionOps) return reverseAddAllTo((InternalFloatCollectionOps) c); if (this.isEmpty()) return false; boolean changed = false; int mc = modCount(); int[] keys = set; for (int i = keys.length - 1; i >= 0; i--) { int key; if ((key = keys[i]) < FREE_BITS) { changed |= c.add(Float.intBitsToFloat(key)); } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return changed; }
public boolean reverseRemoveAllFrom(FloatSet s) { if (s instanceof InternalFloatCollectionOps) return reverseRemoveAllFrom((InternalFloatCollectionOps) s); if (this.isEmpty() || s.isEmpty()) return false; boolean changed = false; int mc = modCount(); int[] keys = set; for (int i = keys.length - 1; i >= 0; i--) { int key; if ((key = keys[i]) < FREE_BITS) { changed |= s.removeFloat(Float.intBitsToFloat(key)); } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return changed; }
public String setToString() { if (this.isEmpty()) return "[]"; StringBuilder sb = new StringBuilder(); int elementCount = 0; int mc = modCount(); int[] keys = set; for (int i = keys.length - 1; i >= 0; i--) { int key; if ((key = keys[i]) < FREE_BITS) { sb.append(' ').append(Float.intBitsToFloat(key)).append(','); if (++elementCount == 8) { int expectedLength = sb.length() * (size() / 8); sb.ensureCapacity(expectedLength + (expectedLength / 2)); } } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); sb.setCharAt(0, '['); sb.setCharAt(sb.length() - 1, ']'); return sb.toString(); }