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

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


        }
    }

    public void forEachWithIndex(final ObjectIntProcedure<? super Integer> objectIntProcedure)
    {
        this.forEachWithIndex(new IntIntProcedure()
        {
            public void value(int each, int index)
            {
                objectIntProcedure.value(each, index);
            }
View Full Code Here


     * Converts the interval to an Integer array
     */
    public int[] toIntArray()
    {
        final int[] result = new int[this.size()];
        this.forEachWithIndex(new IntIntProcedure()
        {
            public void value(int each, int index)
            {
                result[index] = each;
            }
View Full Code Here

    }

    public int[] toArray()
    {
        final int[] result = new int[this.size()];
        this.forEachWithIndex(new IntIntProcedure()
        {
            public void value(int each, int index)
            {
                result[index] = each;
            }
View Full Code Here

    }

    public IntHashBag(IntHashBag bag)
    {
        this.items = new IntIntHashMap(bag.sizeDistinct());
        bag.forEachWithOccurrences(new IntIntProcedure()
        {
            public void value(int item, int occurrences)
            {
                IntHashBag.this.addOccurrences(item, occurrences);
            }
View Full Code Here

    }

    public static IntHashBag newBag(IntBag source)
    {
        final IntHashBag result = new IntHashBag();
        source.forEachWithOccurrences(new IntIntProcedure()
        {
            public void value(int each, int occurrences)
            {
                result.addOccurrences(each, occurrences);
            }
View Full Code Here

            return false;
        }
        if (source instanceof IntBag)
        {
            IntBag otherBag = (IntBag) source;
            otherBag.forEachWithOccurrences(new IntIntProcedure()
            {
                public void value(int each, int occurrences)
                {
                    IntHashBag.this.addOccurrences(each, occurrences);
                }
View Full Code Here

        }
        int oldSize = this.size();
        if (source instanceof IntBag)
        {
            IntBag otherBag = (IntBag) source;
            otherBag.forEachWithOccurrences(new IntIntProcedure()
            {
                public void value(int each, int occurrences)
                {
                    int oldOccurrences = IntHashBag.this.items.removeKeyIfAbsent(each, 0);
                    IntHashBag.this.size -= oldOccurrences;
View Full Code Here

        return true;
    }

    public void forEach(final IntProcedure procedure)
    {
        this.items.forEachKeyValue(new IntIntProcedure()
        {
            public void value(int key, int occurrences)
            {
                for (int i = 0; i < occurrences; i++)
                {
View Full Code Here

    }

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

    }

    public IntHashBag reject(final IntPredicate predicate)
    {
        final IntHashBag result = new IntHashBag();
        this.forEachWithOccurrences(new IntIntProcedure()
        {
            public void value(int each, int occurrences)
            {
                if (!predicate.accept(each))
                {
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.