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

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


    private ByteIntHashMap items;
    private int size;

    public ByteHashBag()
    {
        this.items = new ByteIntHashMap();
    }
View Full Code Here


        this.items = new ByteIntHashMap();
    }

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

        this.addAll(iterable);
    }

    public ByteHashBag(ByteHashBag bag)
    {
        this.items = new ByteIntHashMap(bag.sizeDistinct());
        bag.forEachWithOccurrences(new ByteIntProcedure()
        {
            public void value(byte item, int occurrences)
            {
                ByteHashBag.this.addOccurrences(item, occurrences);
View Full Code Here

    }

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

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

    ImmutableByteIntHashMap(ByteIntMap delegate)
    {
        this.delegate = new ByteIntHashMap(delegate);
    }
View Full Code Here

        return this.delegate.asLazy();
    }

    public ImmutableByteIntMap newWithKeyValue(byte key, int value)
    {
        MutableByteIntMap map = new ByteIntHashMap(this.size() + 1);
        map.putAll(this);
        map.put(key, value);
        return map.toImmutable();
    }
View Full Code Here

        return map.toImmutable();
    }

    public ImmutableByteIntMap newWithoutKey(byte key)
    {
        MutableByteIntMap map = new ByteIntHashMap(this.size());
        map.putAll(this);
        map.removeKey(key);
        return map.toImmutable();
    }
View Full Code Here

        return map.toImmutable();
    }

    public ImmutableByteIntMap newWithoutAllKeys(ByteIterable keys)
    {
        MutableByteIntMap map = new ByteIntHashMap(this.size());
        map.putAll(this);
        ByteIterator iterator = keys.byteIterator();
        while (iterator.hasNext())
        {
            map.removeKey(iterator.next());
        }
        return map.toImmutable();
    }
View Full Code Here

    }

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

                : new ByteIntHashMap().toImmutable();
    }

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

TOP

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

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.