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

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


    private ShortIntHashMap items;
    private int size;

    public ShortHashBag()
    {
        this.items = new ShortIntHashMap();
    }
View Full Code Here


        this.items = new ShortIntHashMap();
    }

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

        this.addAll(iterable);
    }

    public ShortHashBag(ShortHashBag bag)
    {
        this.items = new ShortIntHashMap(bag.sizeDistinct());
        bag.forEachWithOccurrences(new ShortIntProcedure()
        {
            public void value(short item, int occurrences)
            {
                ShortHashBag.this.addOccurrences(item, occurrences);
View Full Code Here

    }

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

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

    ImmutableShortIntHashMap(ShortIntMap delegate)
    {
        this.delegate = new ShortIntHashMap(delegate);
    }
View Full Code Here

        return this.delegate.asLazy();
    }

    public ImmutableShortIntMap newWithKeyValue(short key, int value)
    {
        MutableShortIntMap map = new ShortIntHashMap(this.size() + 1);
        map.putAll(this);
        map.put(key, value);
        return map.toImmutable();
    }
View Full Code Here

        return map.toImmutable();
    }

    public ImmutableShortIntMap newWithoutKey(short key)
    {
        MutableShortIntMap map = new ShortIntHashMap(this.size());
        map.putAll(this);
        map.removeKey(key);
        return map.toImmutable();
    }
View Full Code Here

        return map.toImmutable();
    }

    public ImmutableShortIntMap newWithoutAllKeys(ShortIterable keys)
    {
        MutableShortIntMap map = new ShortIntHashMap(this.size());
        map.putAll(this);
        ShortIterator iterator = keys.shortIterator();
        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();
            MutableShortIntMap deserializedMap = new ShortIntHashMap();

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

            this.map = deserializedMap;
        }
View Full Code Here

    }

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

TOP

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

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.