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

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


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

    ImmutableLongIntHashMap(LongIntMap delegate)
    {
        this.delegate = new LongIntHashMap(delegate);
    }
View Full Code Here


        return this.delegate.asLazy();
    }

    public ImmutableLongIntMap newWithKeyValue(long key, int value)
    {
        MutableLongIntMap map = new LongIntHashMap(this.size() + 1);
        map.putAll(this);
        map.put(key, value);
        return map.toImmutable();
    }
View Full Code Here

        return map.toImmutable();
    }

    public ImmutableLongIntMap newWithoutKey(long key)
    {
        MutableLongIntMap map = new LongIntHashMap(this.size());
        map.putAll(this);
        map.removeKey(key);
        return map.toImmutable();
    }
View Full Code Here

        return map.toImmutable();
    }

    public ImmutableLongIntMap newWithoutAllKeys(LongIterable keys)
    {
        MutableLongIntMap map = new LongIntHashMap(this.size());
        map.putAll(this);
        LongIterator iterator = keys.longIterator();
        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();
            MutableLongIntMap deserializedMap = new LongIntHashMap();

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

            this.map = deserializedMap;
        }
View Full Code Here

    private LongIntHashMap items;
    private int size;

    public LongHashBag()
    {
        this.items = new LongIntHashMap();
    }
View Full Code Here

        this.items = new LongIntHashMap();
    }

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

        this.addAll(iterable);
    }

    public LongHashBag(LongHashBag bag)
    {
        this.items = new LongIntHashMap(bag.sizeDistinct());
        bag.forEachWithOccurrences(new LongIntProcedure()
        {
            public void value(long item, int occurrences)
            {
                LongHashBag.this.addOccurrences(item, occurrences);
View Full Code Here

    }

    public void readExternal(ObjectInput in) throws IOException
    {
        int size = in.readInt();
        this.items = new LongIntHashMap(size);
        for (int i = 0; i < size; i++)
        {
            this.addOccurrences(in.readLong(), in.readInt());
        }
    }
View Full Code Here

    }

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

TOP

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

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.