Package com.gs.collections.api.block.procedure.primitive

Examples of com.gs.collections.api.block.procedure.primitive.ByteIntProcedure


    }

    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 static ByteHashBag newBag(ByteBag source)
    {
        final ByteHashBag result = new ByteHashBag();
        source.forEachWithOccurrences(new ByteIntProcedure()
        {
            public void value(byte each, int occurrences)
            {
                result.addOccurrences(each, occurrences);
            }
View Full Code Here

            return false;
        }
        if (source instanceof ByteBag)
        {
            ByteBag otherBag = (ByteBag) source;
            otherBag.forEachWithOccurrences(new ByteIntProcedure()
            {
                public void value(byte each, int occurrences)
                {
                    ByteHashBag.this.addOccurrences(each, occurrences);
                }
View Full Code Here

        }
        int oldSize = this.size();
        if (source instanceof ByteBag)
        {
            ByteBag otherBag = (ByteBag) source;
            otherBag.forEachWithOccurrences(new ByteIntProcedure()
            {
                public void value(byte each, int occurrences)
                {
                    int oldOccurrences = ByteHashBag.this.items.removeKeyIfAbsent(each, 0);
                    ByteHashBag.this.size -= oldOccurrences;
View Full Code Here

        return true;
    }

    public void forEach(final ByteProcedure procedure)
    {
        this.items.forEachKeyValue(new ByteIntProcedure()
        {
            public void value(byte key, int occurrences)
            {
                for (int i = 0; i < occurrences; i++)
                {
View Full Code Here

    }

    public ByteHashBag select(final BytePredicate predicate)
    {
        final ByteHashBag result = new ByteHashBag();
        this.forEachWithOccurrences(new ByteIntProcedure()
        {
            public void value(byte each, int occurrences)
            {
                if (predicate.accept(each))
                {
View Full Code Here

    }

    public ByteHashBag reject(final BytePredicate predicate)
    {
        final ByteHashBag result = new ByteHashBag();
        this.forEachWithOccurrences(new ByteIntProcedure()
        {
            public void value(byte each, int occurrences)
            {
                if (!predicate.accept(each))
                {
View Full Code Here

    @Override
    public int hashCode()
    {
        final Counter result = new Counter();
        this.forEachWithOccurrences(new ByteIntProcedure()
        {
            public void value(byte eachItem, int occurrences)
            {
                result.add((int) eachItem ^ occurrences);
            }
View Full Code Here

    {
        final boolean[] firstItem = {true};
        try
        {
            appendable.append(start);
            this.items.forEachKeyValue(new ByteIntProcedure()
            {
                public void value(byte each, int occurrences)
                {
                    try
                    {
View Full Code Here

    }

    public int count(final BytePredicate predicate)
    {
        final Counter result = new Counter();
        this.forEachWithOccurrences(new ByteIntProcedure()
        {
            public void value(byte each, int occurrences)
            {
                if (predicate.accept(each))
                {
View Full Code Here

TOP

Related Classes of com.gs.collections.api.block.procedure.primitive.ByteIntProcedure

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.