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

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


        return result;
    }

    public MutableShortBag toBag()
    {
        MutableShortBag result = new ShortHashBag(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


        return set;
    }

    public MutableShortBag toBag()
    {
        final MutableShortBag bag = new ShortHashBag();
        this.forEach(new ShortProcedure()
        {
            public void value(short each)
            {
                bag.add(each);
            }
        });
        return bag;
    }
View Full Code Here

    @Override
    public <R extends MutableShortCollection> R collectShort(final ShortFunction<? super T> shortFunction, final R target)
    {
        if (target instanceof MutableShortBag)
        {
            final MutableShortBag targetBag = (MutableShortBag) target;
            this.forEachWithOccurrences(new ObjectIntProcedure<T>()
            {
                public void value(T each, int occurrences)
                {
                    targetBag.addOccurrences(shortFunction.shortValueOf(each), occurrences);
                }
            });
        }
        else
        {
View Full Code Here

        }

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

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

            this.bag = deserializedBag;
        }
View Full Code Here

TOP

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

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.