@Override public FloatIterator iterator() { return collection.iterator(); } @Override
@Override public FloatIterator iterator() { return FloatIterators.unmodifiable(collection.iterator()); } @Override
/** * Creates a new array list and fills it with a given type-specific collection. * * @param c * a type-specific collection that will be used to fill the array * list. */ public FloatArrayList(final FloatCollection c) { this(c.size()); size = FloatIterators.unwrap(c.iterator(), a); } /**
@Override public boolean containsAll(final FloatCollection c) { for (final FloatIterator i = c.iterator(); i.hasNext();) if (!contains(i.nextFloat())) return false; return true; } @Override
@Override public boolean removeAll(final FloatCollection c) { boolean retVal = false; for (final FloatIterator i = c.iterator(); i.hasNext();) if (rem(i.nextFloat())) retVal = true; return retVal; } @Override
@Override public boolean addAll(final FloatCollection c) { boolean retVal = false; for (final FloatIterator i = c.iterator(); i.hasNext();) if (add(i.nextFloat())) retVal = true; return retVal; } @Override
@Override public boolean addAll(int index, final FloatCollection c) { ensureIndex(index); int n = c.size(); if (n == 0) return false; grow(size + n); if (index != size) System.arraycopy(a, index, a, index + n, size - index); final FloatIterator i = c.iterator(); size += n; while (n-- != 0) a[index++] = i.nextFloat(); assert size <= a.length; return true; } @Override
/** * Remove from this collection all elements which satisfy the given predicate. * * @param filter * a predicate which returns {@code true} for elements to be removed. * @see Collection#removeIf(java.util.function.Predicate) * @return {@code true} if any elements were removed. */ @SuppressWarnings("overloads") default boolean removeIf(final java.util.function.DoublePredicate filter) { java.util.Objects.requireNonNull(filter); boolean removed = false; final FloatIterator each = iterator(); while (each.hasNext()) { if (filter.test(each.nextFloat())) { each.remove(); removed = true; } } return removed; } /**
/** * Creates a new big-array big list and fills it with a given type-specific * collection. * * @param c * a type-specific collection that will be used to fill the array * list. */ public FloatBigArrayBigList(final FloatCollection c) { this(c.size()); for (FloatIterator i = c.iterator(); i.hasNext();) add(i.nextFloat()); } /**
@Override public boolean addAll(int index, final FloatCollection c) { ensureIndex(index); final FloatIterator i = c.iterator(); final boolean retVal = i.hasNext(); while (i.hasNext()) add(index++, i.nextFloat()); return retVal; } /**