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

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


    @Override
    public int hashCode()
    {
        final Counter result = new Counter();
        this.forEachWithOccurrences(new IntIntProcedure()
        {
            public void value(int eachItem, int occurrences)
            {
                result.add(eachItem ^ occurrences);
            }
View Full Code Here


    {
        final boolean[] firstItem = {true};
        try
        {
            appendable.append(start);
            this.items.forEachKeyValue(new IntIntProcedure()
            {
                public void value(int each, int occurrences)
                {
                    try
                    {
View Full Code Here

    }

    public int count(final IntPredicate predicate)
    {
        final Counter result = new Counter();
        this.forEachWithOccurrences(new IntIntProcedure()
        {
            public void value(int each, int occurrences)
            {
                if (predicate.accept(each))
                {
View Full Code Here

    }

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

    }

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

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

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

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

    public void putAll(IntIntMap map)
    {
        map.forEachKeyValue(new IntIntProcedure()
        {
            public void value(int key, int value)
            {
                IntIntHashMap.this.put(key, value);
            }
View Full Code Here

TOP

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

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.