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

Examples of com.gs.collections.impl.map.mutable.primitive.CharIntHashMap$KeysView


    private CharIntHashMap items;
    private int size;

    public CharHashBag()
    {
        this.items = new CharIntHashMap();
    }
View Full Code Here


        this.items = new CharIntHashMap();
    }

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

        this.addAll(iterable);
    }

    public CharHashBag(CharHashBag bag)
    {
        this.items = new CharIntHashMap(bag.sizeDistinct());
        bag.forEachWithOccurrences(new CharIntProcedure()
        {
            public void value(char item, int occurrences)
            {
                CharHashBag.this.addOccurrences(item, occurrences);
View Full Code Here

    }

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

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

    ImmutableCharIntHashMap(CharIntMap delegate)
    {
        this.delegate = new CharIntHashMap(delegate);
    }
View Full Code Here

        return this.delegate.asLazy();
    }

    public ImmutableCharIntMap newWithKeyValue(char key, int value)
    {
        MutableCharIntMap map = new CharIntHashMap(this.size() + 1);
        map.putAll(this);
        map.put(key, value);
        return map.toImmutable();
    }
View Full Code Here

        return map.toImmutable();
    }

    public ImmutableCharIntMap newWithoutKey(char key)
    {
        MutableCharIntMap map = new CharIntHashMap(this.size());
        map.putAll(this);
        map.removeKey(key);
        return map.toImmutable();
    }
View Full Code Here

        return map.toImmutable();
    }

    public ImmutableCharIntMap newWithoutAllKeys(CharIterable keys)
    {
        MutableCharIntMap map = new CharIntHashMap(this.size());
        map.putAll(this);
        CharIterator iterator = keys.charIterator();
        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();
            MutableCharIntMap deserializedMap = new CharIntHashMap();

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

            this.map = deserializedMap;
        }
View Full Code Here

    }

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

TOP

Related Classes of com.gs.collections.impl.map.mutable.primitive.CharIntHashMap$KeysView

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.