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

Examples of com.gs.collections.impl.set.mutable.primitive.IntHashSet


        return new IntArrayList();
    }

    public MutableIntSet toSet()
    {
        return new IntHashSet();
    }
View Full Code Here


        return result.toImmutable();
    }

    public ImmutableIntSet collectInt(IntFunction<? super T> intFunction)
    {
        IntHashSet result = new IntHashSet(this.size());
        this.forEach(new CollectIntProcedure<T>(intFunction, result));
        return result.toImmutable();
    }
View Full Code Here

        return modified;
    }

    public boolean removeAll(int... source)
    {
        IntHashSet set = IntHashSet.newSetWith(source);
        int[] newItems = new int[this.size];
        int count = 0;
        int oldSize = this.size;
        for (int index = 0; index < this.size; index++)
        {
            if (!set.contains(this.items[index]))
            {
                newItems[count] = this.items[index];
                count++;
            }
        }
View Full Code Here

    }

    public ImmutableIntSet select(IntPredicate predicate)
    {
        return predicate.accept(this.element) ? IntHashSet.newSetWith(this.element).toImmutable()
                : new IntHashSet().toImmutable();
    }
View Full Code Here

                : new IntHashSet().toImmutable();
    }

    public ImmutableIntSet reject(IntPredicate predicate)
    {
        return predicate.accept(this.element) ? new IntHashSet().toImmutable()
                : IntHashSet.newSetWith(this.element).toImmutable();
    }
View Full Code Here

    }

    @Override
    public MutableIntSet collectInt(IntFunction<? super T> intFunction)
    {
        IntHashSet result = new IntHashSet(this.size());
        this.forEach(new CollectIntProcedure<T>(intFunction, result));
        return result;
    }
View Full Code Here

    }

    public void readExternal(ObjectInput in) throws IOException
    {
        int size = in.readInt();
        MutableIntSet deserializedSet = new IntHashSet(size);

        for (int i = 0; i < size; i++)
        {
            deserializedSet.add(in.readInt());
        }

        this.set = deserializedSet;
    }
View Full Code Here

        return 0;
    }

    public MutableIntSet toSet()
    {
        return new IntHashSet();
    }
View Full Code Here

            IntObjectHashMap.this.clear();
        }

        public MutableIntSet select(IntPredicate predicate)
        {
            MutableIntSet result = new IntHashSet();
            if (IntObjectHashMap.this.sentinelValues != null)
            {
                if (IntObjectHashMap.this.sentinelValues.containsZeroKey && predicate.accept(EMPTY_KEY))
                {
                    result.add(EMPTY_KEY);
                }
                if (IntObjectHashMap.this.sentinelValues.containsOneKey && predicate.accept(REMOVED_KEY))
                {
                    result.add(REMOVED_KEY);
                }
            }
            for (int key : IntObjectHashMap.this.keys)
            {
                if (isNonSentinel(key) && predicate.accept(key))
                {
                    result.add(key);
                }
            }
            return result;
        }
View Full Code Here

            return result;
        }

        public MutableIntSet reject(IntPredicate predicate)
        {
            MutableIntSet result = new IntHashSet();
            if (IntObjectHashMap.this.sentinelValues != null)
            {
                if (IntObjectHashMap.this.sentinelValues.containsZeroKey && !predicate.accept(EMPTY_KEY))
                {
                    result.add(EMPTY_KEY);
                }
                if (IntObjectHashMap.this.sentinelValues.containsOneKey && !predicate.accept(REMOVED_KEY))
                {
                    result.add(REMOVED_KEY);
                }
            }
            for (int key : IntObjectHashMap.this.keys)
            {
                if (isNonSentinel(key) && !predicate.accept(key))
                {
                    result.add(key);
                }
            }
            return result;
        }
View Full Code Here

TOP

Related Classes of com.gs.collections.impl.set.mutable.primitive.IntHashSet

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.