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

Examples of com.gs.collections.impl.bag.mutable.primitive.BooleanHashBag


        return set;
    }

    public MutableBooleanBag toBag()
    {
        final MutableBooleanBag bag = new BooleanHashBag();
        this.forEach(new BooleanProcedure()
        {
            public void value(boolean each)
            {
                bag.add(each);
            }
        });
        return bag;
    }
View Full Code Here


        return BooleanHashBag.newBag(this.delegate).with(element).toImmutable();
    }

    public ImmutableBooleanBag newWithout(boolean element)
    {
        BooleanHashBag hashBag = BooleanHashBag.newBag(this.delegate);
        hashBag.remove(element);
        return hashBag.toImmutable();
    }
View Full Code Here

        return hashBag.toImmutable();
    }

    public ImmutableBooleanBag newWithAll(BooleanIterable elements)
    {
        BooleanHashBag bag = BooleanHashBag.newBag(this.delegate);
        bag.addAll(elements);
        return bag.toImmutable();
    }
View Full Code Here

        return bag.toImmutable();
    }

    public ImmutableBooleanBag newWithoutAll(BooleanIterable elements)
    {
        BooleanHashBag bag = BooleanHashBag.newBag(this.delegate);
        bag.removeAll(elements);
        return bag.toImmutable();
    }
View Full Code Here

        }

        public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
        {
            int size = in.readInt();
            MutableBooleanBag deserializedBag = new BooleanHashBag();

            for (int i = 0; i < size; i++)
            {
                deserializedBag.addOccurrences(in.readBoolean(), in.readInt());
            }

            this.bag = deserializedBag;
        }
View Full Code Here

        return new BooleanHashSet();
    }

    public MutableBooleanBag toBag()
    {
        return new BooleanHashBag();
    }
View Full Code Here

        return partitionMutableBag.toImmutable();
    }

    public ImmutableBooleanBag collectBoolean(final BooleanFunction<? super T> booleanFunction)
    {
        final BooleanHashBag result = new BooleanHashBag();
        this.forEachWithOccurrences(new ObjectIntProcedure<T>()
        {
            public void value(T each, int occurrences)
            {
                result.addOccurrences(booleanFunction.booleanValueOf(each), occurrences);
            }
        });
        return result.toImmutable();
    }
View Full Code Here

        return result;
    }

    public MutableBooleanBag collectBoolean(BooleanFunction<? super T> booleanFunction)
    {
        return this.collectBoolean(booleanFunction, new BooleanHashBag());
    }
View Full Code Here

    }

    public ImmutableBooleanBag select(BooleanPredicate predicate)
    {
        return predicate.accept(this.element1) ? BooleanHashBag.newBagWith(this.element1).toImmutable()
                : new BooleanHashBag().toImmutable();
    }
View Full Code Here

                : new BooleanHashBag().toImmutable();
    }

    public ImmutableBooleanBag reject(BooleanPredicate predicate)
    {
        return predicate.accept(this.element1) ? new BooleanHashBag().toImmutable()
                : BooleanHashBag.newBagWith(this.element1).toImmutable();
    }
View Full Code Here

TOP

Related Classes of com.gs.collections.impl.bag.mutable.primitive.BooleanHashBag

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.