@Override public int size() { synchronized (sync) { return collection.size(); } } @Override
@Override public int size() { return collection.size(); } @Override
/** * Creates a new array set copying the contents of a given collection. * * @param c * a collection. */ public FloatArraySet(FloatCollection c) { this(c.size()); addAll(c); } /**
/** * Creates a new hash set copying a given type-specific collection. * * @param c * a type-specific collection to be copied into the new hash set. * @param f * the load factor. */ public FloatLinkedOpenHashSet(final FloatCollection c, final float f) { this(c.size(), f); addAll(c); } /**
/** * Creates a new hash set copying a given type-specific collection. * * @param c * a type-specific collection to be copied into the new hash set. * @param f * the load factor. */ public FloatOpenHashSet(final FloatCollection c, final float f) { this(c.size(), f); addAll(c); } /**
/** * Creates a new hash big set copying a given type-specific collection. * * @param c * a type-specific collection to be copied into the new hash big set. * @param f * the load factor. */ public FloatOpenHashBigSet(final FloatCollection c, final float f) { this(c.size(), f); addAll(c); } /**
/** * Creates a new hash set copying a given type-specific collection. * * @param c * a type-specific collection to be copied into the new hash set. * @param f * the load factor. * @param strategy * the strategy. */ public FloatLinkedOpenCustomHashSet(final FloatCollection c, final float f, it.unimi.dsi.fastutil.floats.FloatHash.Strategy strategy) { this(c.size(), f, strategy); addAll(c); } /**
/** * Creates a new hash set copying a given type-specific collection. * * @param c * a type-specific collection to be copied into the new hash set. * @param f * the load factor. * @param strategy * the strategy. */ public FloatOpenCustomHashSet(final FloatCollection c, final float f, it.unimi.dsi.fastutil.floats.FloatHash.Strategy strategy) { this(c.size(), f, strategy); addAll(c); } /**
@Override public boolean addAll(FloatCollection c) { if (f <= .5) ensureCapacity(c.size()); // The resulting collection will be sized for c.size() elements else tryCapacity(size() + c.size()); // The resulting collection will be tentatively sized for size() + c.size() // elements return super.addAll(c); } @Override
@Override public boolean addAll(FloatCollection c) { if (f <= .5) ensureCapacity(c.size()); // The resulting collection will be sized for c.size() elements else tryCapacity(size() + c.size()); // The resulting collection will be tentatively sized for size() + c.size() // elements return super.addAll(c); } @Override
@Override public boolean addAll(FloatCollection c) { if (f <= .5) ensureCapacity(c.size()); // The resulting collection will be sized for c.size() elements else tryCapacity(size() + c.size()); // The resulting collection will be tentatively sized for size() + c.size() // elements return super.addAll(c); } @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 addAll(FloatCollection c) { if (f <= .5) ensureCapacity(c.size()); // The resulting collection will be sized for c.size() elements else tryCapacity(size() + c.size()); // The resulting collection will be tentatively sized for size() + c.size() // elements return super.addAll(c); } @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
/** * 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(FloatCollection c) { final long size = c instanceof Size64 ? ((Size64) c).size64() : c.size(); if (f <= .5) ensureCapacity(size); // The resulting collection will be size for c.size() elements else ensureCapacity(size64() + size); // The resulting collection will be sized for size() + c.size() elements return super.addAll(c); } @Override