Package com.gs.collections.impl.map.mutable.primitive

Examples of com.gs.collections.impl.map.mutable.primitive.DoubleIntHashMap$InternalIntIterator


    private DoubleIntHashMap items;
    private int size;

    public DoubleHashBag()
    {
        this.items = new DoubleIntHashMap();
    }
View Full Code Here


        this.items = new DoubleIntHashMap();
    }

    public DoubleHashBag(int size)
    {
        this.items = new DoubleIntHashMap(size);
    }
View Full Code Here

        this.addAll(iterable);
    }

    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 void readExternal(ObjectInput in) throws IOException
    {
        int size = in.readInt();
        this.items = new DoubleIntHashMap(size);
        for (int i = 0; i < size; i++)
        {
            this.addOccurrences(in.readDouble(), in.readInt());
        }
    }
View Full Code Here

    }

    public ImmutableDoubleIntMap select(DoubleIntPredicate predicate)
    {
        return predicate.accept(this.key1, this.value1) ? DoubleIntHashMap.newWithKeysValues(this.key1, this.value1).toImmutable()
                : new DoubleIntHashMap().toImmutable();
    }
View Full Code Here

                : new DoubleIntHashMap().toImmutable();
    }

    public ImmutableDoubleIntMap reject(DoubleIntPredicate predicate)
    {
        return predicate.accept(this.key1, this.value1) ? new DoubleIntHashMap().toImmutable()
                : DoubleIntHashMap.newWithKeysValues(this.key1, this.value1).toImmutable();
    }
View Full Code Here

    private static final long serialVersionUID = 1L;
    private final MutableDoubleIntMap delegate;

    ImmutableDoubleIntHashMap(DoubleIntMap delegate)
    {
        this.delegate = new DoubleIntHashMap(delegate);
    }
View Full Code Here

        return this.delegate.asLazy();
    }

    public ImmutableDoubleIntMap newWithKeyValue(double key, int value)
    {
        MutableDoubleIntMap map = new DoubleIntHashMap(this.size() + 1);
        map.putAll(this);
        map.put(key, value);
        return map.toImmutable();
    }
View Full Code Here

        return map.toImmutable();
    }

    public ImmutableDoubleIntMap newWithoutKey(double key)
    {
        MutableDoubleIntMap map = new DoubleIntHashMap(this.size());
        map.putAll(this);
        map.removeKey(key);
        return map.toImmutable();
    }
View Full Code Here

        return map.toImmutable();
    }

    public ImmutableDoubleIntMap newWithoutAllKeys(DoubleIterable keys)
    {
        MutableDoubleIntMap map = new DoubleIntHashMap(this.size());
        map.putAll(this);
        DoubleIterator iterator = keys.doubleIterator();
        while (iterator.hasNext())
        {
            map.removeKey(iterator.next());
        }
        return map.toImmutable();
    }
View Full Code Here

TOP

Related Classes of com.gs.collections.impl.map.mutable.primitive.DoubleIntHashMap$InternalIntIterator

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.