Package com.gs.collections.api.block.procedure.primitive

Examples of com.gs.collections.api.block.procedure.primitive.ShortIntProcedure


    }

    public <V> MutableBag<V> collect(final ShortToObjectFunction<? extends V> function)
    {
        final HashBag<V> result = HashBag.newBag(this.items.size());
        this.forEachWithOccurrences(new ShortIntProcedure()
        {
            public void value(short each, int occurrences)
            {
                result.addOccurrences(function.valueOf(each), occurrences);
            }
View Full Code Here


    }

    public long sum()
    {
        final long[] result = {0L};
        this.forEachWithOccurrences(new ShortIntProcedure()
        {
            public void value(short each, int occurrences)
            {
                result[0] += (long) each * occurrences;
            }
View Full Code Here

    public short[] toArray()
    {
        final short[] array = new short[this.size()];
        final int[] index = {0};

        this.forEachWithOccurrences(new ShortIntProcedure()
        {
            public void value(short each, int occurrences)
            {
                for (int i = 0; i < occurrences; i++)
                {
View Full Code Here

    public void writeExternal(final ObjectOutput out) throws IOException
    {
        out.writeInt(this.items.size());
        try
        {
            this.items.forEachKeyValue(new ShortIntProcedure()
            {
                public void value(short each, int occurrences)
                {
                    try
                    {
View Full Code Here

        this.addKeyValueAtIndex(key, value, index);
    }

    public void putAll(ShortIntMap map)
    {
        map.forEachKeyValue(new ShortIntProcedure()
        {
            public void value(short key, int value)
            {
                ShortIntHashMap.this.put(key, value);
            }
View Full Code Here

TOP

Related Classes of com.gs.collections.api.block.procedure.primitive.ShortIntProcedure

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.