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

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


    }

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

            return false;
        }
        if (source instanceof CharBag)
        {
            CharBag otherBag = (CharBag) source;
            otherBag.forEachWithOccurrences(new CharIntProcedure()
            {
                public void value(char each, int occurrences)
                {
                    CharHashBag.this.addOccurrences(each, occurrences);
                }
View Full Code Here

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

        return true;
    }

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

    }

    public CharHashBag select(final CharPredicate predicate)
    {
        final CharHashBag result = new CharHashBag();
        this.forEachWithOccurrences(new CharIntProcedure()
        {
            public void value(char each, int occurrences)
            {
                if (predicate.accept(each))
                {
View Full Code Here

    }

    public CharHashBag reject(final CharPredicate predicate)
    {
        final CharHashBag result = new CharHashBag();
        this.forEachWithOccurrences(new CharIntProcedure()
        {
            public void value(char each, int occurrences)
            {
                if (!predicate.accept(each))
                {
View Full Code Here

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

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

    }

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

TOP

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

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.