@Override @Nonnull public FloatCollection values() { return new ValueView(); }
@Override public String toString() { if (isEmpty()) return "[]"; StringBuilder sb = new StringBuilder(); int elementCount = 0; int mc = modCount(); long[] tab = table; long entry; for (int i = tab.length - 1; i >= 0; i--) { if ((int) (entry = tab[i]) < FREE_BITS) { sb.append(' ').append(Float.intBitsToFloat((int) (entry >>> 32))).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 @SuppressWarnings("unchecked") @Nonnull public <T> T[] toArray(@Nonnull T[] a) { int size = size(); if (a.length < size) { Class<?> elementType = a.getClass().getComponentType(); a = (T[]) java.lang.reflect.Array.newInstance(elementType, size); } if (size == 0) { if (a.length > 0) a[0] = null; return a; } int resultIndex = 0; int mc = modCount(); long[] tab = table; long entry; for (int i = tab.length - 1; i >= 0; i--) { if ((int) (entry = tab[i]) < FREE_BITS) { a[resultIndex++] = (T) Float.valueOf(Float.intBitsToFloat((int) (entry >>> 32))); } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); if (a.length > resultIndex) a[resultIndex] = null; return a; }
@Override @SuppressWarnings("unchecked") @Nonnull public <T> T[] toArray(@Nonnull T[] a) { int size = size(); if (a.length < size) { Class<?> elementType = a.getClass().getComponentType(); a = (T[]) java.lang.reflect.Array.newInstance(elementType, size); } if (size == 0) { if (a.length > 0) a[0] = null; return a; } int resultIndex = 0; int mc = modCount(); long[] tab = table; long entry; for (int i = tab.length - 1; i >= 0; i--) { if ((int) (entry = tab[i]) < FREE_BITS) { a[resultIndex++] = (T) Float.valueOf(Float.intBitsToFloat((int) (entry >>> 32))); } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); if (a.length > resultIndex) a[resultIndex] = null; return a; }
@Override public float[] toArray(float[] a) { int size = size(); if (a.length < size) a = new float[size]; if (size == 0) { if (a.length > 0) a[0] = 0.0f; return a; } int resultIndex = 0; int mc = modCount(); long[] tab = table; long entry; for (int i = tab.length - 1; i >= 0; i--) { if ((int) (entry = tab[i]) < FREE_BITS) { a[resultIndex++] = Float.intBitsToFloat((int) (entry >>> 32)); } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); if (a.length > resultIndex) a[resultIndex] = 0.0f; return a; }
@Override public boolean forEachWhile(FloatPredicate predicate) { if (predicate == null) throw new java.lang.NullPointerException(); if (isEmpty()) return true; boolean terminated = false; int mc = modCount(); long[] tab = table; long entry; for (int i = tab.length - 1; i >= 0; i--) { if ((int) (entry = tab[i]) < FREE_BITS) { if (!predicate.test(Float.intBitsToFloat((int) (entry >>> 32)))) { terminated = true; break; } } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return !terminated; }
@Override public float[] toArray(float[] a) { int size = size(); if (a.length < size) a = new float[size]; if (size == 0) { if (a.length > 0) a[0] = 0.0f; return a; } int resultIndex = 0; int mc = modCount(); long[] tab = table; long entry; for (int i = tab.length - 1; i >= 0; i--) { if ((int) (entry = tab[i]) < FREE_BITS) { a[resultIndex++] = Float.intBitsToFloat((int) (entry >>> 32)); } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); if (a.length > resultIndex) a[resultIndex] = 0.0f; return a; }
@Override public boolean forEachWhile(FloatPredicate predicate) { if (predicate == null) throw new java.lang.NullPointerException(); if (isEmpty()) return true; boolean terminated = false; int mc = modCount(); long[] tab = table; long entry; for (int i = tab.length - 1; i >= 0; i--) { if ((int) (entry = tab[i]) < FREE_BITS) { if (!predicate.test(Float.intBitsToFloat((int) (entry >>> 32)))) { terminated = true; break; } } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return !terminated; }
@Override public boolean allContainingIn(FloatCollection c) { if (c instanceof InternalFloatCollectionOps) return allContainingIn((InternalFloatCollectionOps) c); if (isEmpty()) return true; boolean containsAll = true; int mc = modCount(); long[] tab = table; long entry; for (int i = tab.length - 1; i >= 0; i--) { if ((int) (entry = tab[i]) < FREE_BITS) { if (!c.contains(Float.intBitsToFloat((int) (entry >>> 32)))) { containsAll = false; break; } } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return containsAll; }
@Override @Nonnull public Object[] toArray() { int size = size(); Object[] result = new Object[size]; if (size == 0) return result; int resultIndex = 0; int mc = modCount(); long[] tab = table; long entry; for (int i = tab.length - 1; i >= 0; i--) { if ((int) (entry = tab[i]) < FREE_BITS) { result[resultIndex++] = Float.intBitsToFloat((int) (entry >>> 32)); } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return result; }
@Override public String toString() { if (isEmpty()) return "[]"; StringBuilder sb = new StringBuilder(); int elementCount = 0; int mc = modCount(); long[] tab = table; long entry; for (int i = tab.length - 1; i >= 0; i--) { if ((int) (entry = tab[i]) < FREE_BITS) { sb.append(' ').append(Float.intBitsToFloat((int) (entry >>> 32))).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 public boolean allContainingIn(FloatCollection c) { if (c instanceof InternalFloatCollectionOps) return allContainingIn((InternalFloatCollectionOps) c); if (isEmpty()) return true; boolean containsAll = true; int mc = modCount(); long[] tab = table; long entry; for (int i = tab.length - 1; i >= 0; i--) { if ((int) (entry = tab[i]) < FREE_BITS) { if (!c.contains(Float.intBitsToFloat((int) (entry >>> 32)))) { containsAll = false; break; } } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return containsAll; }
@Override public float[] toFloatArray() { int size = size(); float[] result = new float[size]; if (size == 0) return result; int resultIndex = 0; int mc = modCount(); long[] tab = table; long entry; for (int i = tab.length - 1; i >= 0; i--) { if ((int) (entry = tab[i]) < FREE_BITS) { result[resultIndex++] = Float.intBitsToFloat((int) (entry >>> 32)); } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return result; }
@Override public boolean reverseRemoveAllFrom(FloatSet s) { if (s instanceof InternalFloatCollectionOps) return reverseRemoveAllFrom((InternalFloatCollectionOps) s); if (isEmpty() || s.isEmpty()) return false; boolean changed = false; int mc = modCount(); long[] tab = table; long entry; for (int i = tab.length - 1; i >= 0; i--) { if ((int) (entry = tab[i]) < FREE_BITS) { changed |= s.removeFloat(Float.intBitsToFloat((int) (entry >>> 32))); } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return changed; }
@Override public boolean reverseRemoveAllFrom(FloatSet s) { if (s instanceof InternalFloatCollectionOps) return reverseRemoveAllFrom((InternalFloatCollectionOps) s); if (isEmpty() || s.isEmpty()) return false; boolean changed = false; int mc = modCount(); long[] tab = table; long entry; for (int i = tab.length - 1; i >= 0; i--) { if ((int) (entry = tab[i]) < FREE_BITS) { changed |= s.removeFloat(Float.intBitsToFloat((int) (entry >>> 32))); } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return changed; }
@Override public boolean reverseAddAllTo(FloatCollection c) { if (c instanceof InternalFloatCollectionOps) return reverseAddAllTo((InternalFloatCollectionOps) c); if (isEmpty()) return false; boolean changed = false; int mc = modCount(); long[] tab = table; long entry; for (int i = tab.length - 1; i >= 0; i--) { if ((int) (entry = tab[i]) < FREE_BITS) { changed |= c.add(Float.intBitsToFloat((int) (entry >>> 32))); } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return changed; }
@Override @Nonnull public Object[] toArray() { int size = size(); Object[] result = new Object[size]; if (size == 0) return result; int resultIndex = 0; int mc = modCount(); long[] tab = table; long entry; for (int i = tab.length - 1; i >= 0; i--) { if ((int) (entry = tab[i]) < FREE_BITS) { result[resultIndex++] = Float.intBitsToFloat((int) (entry >>> 32)); } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return result; }
private boolean allContainingIn(InternalFloatCollectionOps c) { if (isEmpty()) return true; boolean containsAll = true; int mc = modCount(); long[] tab = table; long entry; for (int i = tab.length - 1; i >= 0; i--) { if ((int) (entry = tab[i]) < FREE_BITS) { if (!c.contains((int) (entry >>> 32))) { containsAll = false; break; } } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return containsAll; }
private boolean allContainingIn(InternalFloatCollectionOps c) { if (isEmpty()) return true; boolean containsAll = true; int mc = modCount(); long[] tab = table; long entry; for (int i = tab.length - 1; i >= 0; i--) { if ((int) (entry = tab[i]) < FREE_BITS) { if (!c.contains((int) (entry >>> 32))) { containsAll = false; break; } } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return containsAll; }
@Override public boolean reverseAddAllTo(FloatCollection c) { if (c instanceof InternalFloatCollectionOps) return reverseAddAllTo((InternalFloatCollectionOps) c); if (isEmpty()) return false; boolean changed = false; int mc = modCount(); long[] tab = table; long entry; for (int i = tab.length - 1; i >= 0; i--) { if ((int) (entry = tab[i]) < FREE_BITS) { changed |= c.add(Float.intBitsToFloat((int) (entry >>> 32))); } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return changed; }