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

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


    }

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


    }

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

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

        this.forEachWithOccurrences(new CharIntProcedure()
        {
            public void value(char 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 CharIntProcedure()
            {
                public void value(char each, int occurrences)
                {
                    try
                    {
View Full Code Here

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

    public void putAll(CharIntMap map)
    {
        map.forEachKeyValue(new CharIntProcedure()
        {
            public void value(char key, int value)
            {
                CharIntHashMap.this.put(key, value);
            }
View Full Code Here

TOP

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

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.