Package com.gs.collections.api.iterator

Examples of com.gs.collections.api.iterator.CharIterator


            return sum;
        }

        public char max()
        {
            CharIterator charIterator = this.charIterator();
            char max = charIterator.next();
            while (charIterator.hasNext())
            {
                max = (char) Math.max(max, charIterator.next());
            }
            return max;
        }
View Full Code Here


            return max;
        }

        public char min()
        {
            CharIterator charIterator = this.charIterator();
            char min = charIterator.next();
            while (charIterator.hasNext())
            {
                min = (char) Math.min(min, charIterator.next());
            }
            return min;
        }
View Full Code Here

        return new ReverseCharIterator();
    }

    public void forEach(CharProcedure procedure)
    {
        CharIterator iterator = this.charIterator();
        while (iterator.hasNext())
        {
            procedure.value(iterator.next());
        }
    }
View Full Code Here

    @Override
    public char[] toArray()
    {
        char[] results = new char[this.adapted.size()];
        int index = 0;
        CharIterator iterator = this.charIterator();
        while (iterator.hasNext())
        {
            results[index] = iterator.next();
            index++;
        }
        return results;
    }
View Full Code Here

    {
        try
        {
            appendable.append(start);

            CharIterator iterator = iterable.charIterator();
            if (iterator.hasNext())
            {
                appendable.append(stringValueOfItem(iterable, iterator.next()));
                while (iterator.hasNext())
                {
                    appendable.append(separator);
                    appendable.append(stringValueOfItem(iterable, iterator.next()));
                }
            }

            appendable.append(end);
        }
View Full Code Here

                }
            });
        }
        else
        {
            CharIterator iterator = source.charIterator();
            while (iterator.hasNext())
            {
                char each = iterator.next();
                this.add(each);
            }
        }
        return true;
    }
View Full Code Here

                }
            });
        }
        else
        {
            CharIterator iterator = source.charIterator();
            while (iterator.hasNext())
            {
                char each = iterator.next();
                int occurrences = this.items.removeKeyIfAbsent(each, 0);
                this.size -= occurrences;
            }
        }
        return this.size() != oldSize;
View Full Code Here

    }

    public <T> T injectInto(T injectedValue, ObjectCharToObjectFunction<? super T, ? extends T> function)
    {
        T result = injectedValue;
        CharIterator it = this.charIterator();
        while (it.hasNext())
        {
            result = function.valueOf(result, it.next());
        }
        return result;
    }
View Full Code Here

    @Override
    public int hashCode()
    {
        int hashCode = 1;
        CharIterable iterable = this.delegate.asReversed();
        CharIterator iterator = iterable.charIterator();
        while (iterator.hasNext())
        {
            char item = iterator.next();
            hashCode = 31 * hashCode + (int) item;
        }
        return hashCode;
    }
View Full Code Here

                }
            }
        }
        else
        {
            CharIterator iterator = source.charIterator();
            while (iterator.hasNext())
            {
                char item = iterator.next();
                this.add(item);
            }
        }
        return this.size() != oldSize;
    }
View Full Code Here

TOP

Related Classes of com.gs.collections.api.iterator.CharIterator

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.