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

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


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

    public void putAll(DoubleIntMap map)
    {
        map.forEachKeyValue(new DoubleIntProcedure()
        {
            public void value(double key, int value)
            {
                DoubleIntHashMap.this.put(key, value);
            }
View Full Code Here


    }

    public DoubleHashBag(DoubleHashBag bag)
    {
        this.items = new DoubleIntHashMap(bag.sizeDistinct());
        bag.forEachWithOccurrences(new DoubleIntProcedure()
        {
            public void value(double item, int occurrences)
            {
                DoubleHashBag.this.addOccurrences(item, occurrences);
            }
View Full Code Here

    }

    public static DoubleHashBag newBag(DoubleBag source)
    {
        final DoubleHashBag result = new DoubleHashBag();
        source.forEachWithOccurrences(new DoubleIntProcedure()
        {
            public void value(double each, int occurrences)
            {
                result.addOccurrences(each, occurrences);
            }
View Full Code Here

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

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

        return true;
    }

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

    }

    public DoubleHashBag select(final DoublePredicate predicate)
    {
        final DoubleHashBag result = new DoubleHashBag();
        this.forEachWithOccurrences(new DoubleIntProcedure()
        {
            public void value(double each, int occurrences)
            {
                if (predicate.accept(each))
                {
View Full Code Here

    }

    public DoubleHashBag reject(final DoublePredicate predicate)
    {
        final DoubleHashBag result = new DoubleHashBag();
        this.forEachWithOccurrences(new DoubleIntProcedure()
        {
            public void value(double each, int occurrences)
            {
                if (!predicate.accept(each))
                {
View Full Code Here

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

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

TOP

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

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.