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

Examples of com.gs.collections.impl.map.mutable.primitive.IntIntHashMap


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

    ImmutableIntIntHashMap(IntIntMap delegate)
    {
        this.delegate = new IntIntHashMap(delegate);
    }
View Full Code Here


        return this.delegate.asLazy();
    }

    public ImmutableIntIntMap newWithKeyValue(int key, int value)
    {
        MutableIntIntMap map = new IntIntHashMap(this.size() + 1);
        map.putAll(this);
        map.put(key, value);
        return map.toImmutable();
    }
View Full Code Here

        return map.toImmutable();
    }

    public ImmutableIntIntMap newWithoutKey(int key)
    {
        MutableIntIntMap map = new IntIntHashMap(this.size());
        map.putAll(this);
        map.removeKey(key);
        return map.toImmutable();
    }
View Full Code Here

        return map.toImmutable();
    }

    public ImmutableIntIntMap newWithoutAllKeys(IntIterable keys)
    {
        MutableIntIntMap map = new IntIntHashMap(this.size());
        map.putAll(this);
        IntIterator iterator = keys.intIterator();
        while (iterator.hasNext())
        {
            map.removeKey(iterator.next());
        }
        return map.toImmutable();
    }
View Full Code Here

        }

        public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
        {
            int size = in.readInt();
            MutableIntIntMap deserializedMap = new IntIntHashMap();

            for (int i = 0; i < size; i++)
            {
                deserializedMap.put(in.readInt(), in.readInt());
            }

            this.map = deserializedMap;
        }
View Full Code Here

    private IntIntHashMap items;
    private int size;

    public IntHashBag()
    {
        this.items = new IntIntHashMap();
    }
View Full Code Here

        this.items = new IntIntHashMap();
    }

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

        this.addAll(iterable);
    }

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

    }

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

TOP

Related Classes of com.gs.collections.impl.map.mutable.primitive.IntIntHashMap

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.