Package com.gs.collections.api.bag.primitive

Examples of com.gs.collections.api.bag.primitive.MutableFloatBag


        return set;
    }

    public MutableFloatBag toBag()
    {
        final MutableFloatBag bag = new FloatHashBag();
        this.forEach(new FloatProcedure()
        {
            public void value(float each)
            {
                bag.add(each);
            }
        });
        return bag;
    }
View Full Code Here


    @Override
    public <R extends MutableFloatCollection> R collectFloat(final FloatFunction<? super T> floatFunction, final R target)
    {
        if (target instanceof MutableFloatBag)
        {
            final MutableFloatBag targetBag = (MutableFloatBag) target;
            this.forEachWithOccurrences(new ObjectIntProcedure<T>()
            {
                public void value(T each, int occurrences)
                {
                    targetBag.addOccurrences(floatFunction.floatValueOf(each), occurrences);
                }
            });
        }
        else
        {
View Full Code Here

        }

        public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
        {
            int size = in.readInt();
            MutableFloatBag deserializedBag = new FloatHashBag();

            for (int i = 0; i < size; i++)
            {
                deserializedBag.addOccurrences(in.readFloat(), in.readInt());
            }

            this.bag = deserializedBag;
        }
View Full Code Here

        return result;
    }

    public MutableFloatBag toBag()
    {
        MutableFloatBag result = new FloatHashBag(this.size());

        for (int i = 0; i < this.keys.length; i++)
        {
            if (isNonSentinel(this.keys[i]))
            {
                result.add(this.values[i]);
            }
        }
        return result;
    }
View Full Code Here

TOP

Related Classes of com.gs.collections.api.bag.primitive.MutableFloatBag

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.