Package com.carrotsearch.hppc.procedures

Examples of com.carrotsearch.hppc.procedures.IntProcedure


        // Deques also support iteration through [type]Procedure interfaces.
        // The apply() method will be called once for each element in the deque.
       
        // Iteration from head to tail
        deque.forEach(new IntProcedure()
        {
            public void apply(int value)
            {
                System.out.println(value);
            }
View Full Code Here


        // [[[start:iteration-lists-using-procedures]]]
        final IntArrayList list = prepare(10);

        // Lists also support iteration through [type]Procedure interfaces.
        // The apply() method will be called once for each element in the list.
        list.forEach(new IntProcedure()
        {
            public void apply(int value)
            {
                System.out.println(value);
            }
View Full Code Here

        // Sets also support iteration through [type]Procedure interfaces.
        // The apply() method will be called once for each element in the set.
       
        // Iteration from head to tail
        set.forEach(new IntProcedure()
        {
            public void apply(int value)
            {
                System.out.println(value);
            }
View Full Code Here

    /* */
    @Test
    public void testWithProcedureClosure()
    {
        final IntHolder count = new IntHolder();
        list.forEach(new IntProcedure() {
            public void apply(int v)
            {
                if (v != defValue)
                    count.value++;
            }
View Full Code Here

    public void testForEachWithProcedure()
    {
        deque.addLast(sequence);

        final IntHolder count = new IntHolder();
        ((IntArrayDeque) deque).forEach(new IntProcedure() {
            int index = 0;
            public void apply(int v)
            {
                assertEquals2(sequence.buffer[index++], v);
                count.value++;
View Full Code Here

    public void testDescendingForEachWithProcedure()
    {
        deque.addLast(sequence);

        final IntHolder count = new IntHolder();
        ((IntArrayDeque) deque).descendingForEach(new IntProcedure() {
            int index = sequence.size();
            public void apply(int v)
            {
                assertEquals2(sequence.buffer[--index], v);
                count.value++;
View Full Code Here

TOP

Related Classes of com.carrotsearch.hppc.procedures.IntProcedure

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.