Examples of binarySearch()


Examples of gnu.trove.list.TIntList.binarySearch()

        // Not in this range.
        index = a.binarySearch( 5, 15, 30 );
        assertTrue( "index: " + index, index < 0 );

        try {
            a.binarySearch( 5, 10, 55 );
            fail( "Expected ArrayIndexOutOfBoundsException" );
        }
        catch ( ArrayIndexOutOfBoundsException ex ) {
            // Expected
        }
View Full Code Here

Examples of gnu.trove.list.TIntList.binarySearch()

        catch ( ArrayIndexOutOfBoundsException ex ) {
            // Expected
        }

        try {
            a.binarySearch( 5, -1, 15 );
            fail( "Expected ArrayIndexOutOfBoundsException" );
        }
        catch ( ArrayIndexOutOfBoundsException ex ) {
            // Expected
        }
View Full Code Here

Examples of gnu.trove.list.TIntList.binarySearch()

            a.add( i );
        }

        a.sort();

        int index = a.binarySearch( 5 );
        assertEquals( 4, index );

        index = a.binarySearch( 8 );
        assertEquals( 7, index );
View Full Code Here

Examples of gnu.trove.list.TIntList.binarySearch()

        a.sort();

        int index = a.binarySearch( 5 );
        assertEquals( 4, index );

        index = a.binarySearch( 8 );
        assertEquals( 7, index );

        // Add more elements, but duplicates
        for ( int i = 1; i <= element_count; i++ ) {
            a.add( i );
View Full Code Here

Examples of gnu.trove.list.TIntList.binarySearch()

        index = a.indexOf( 5 );
        assertTrue( "index: " + index, index >= 8 && index <= 9 );

        // Not in this range.
        index = a.binarySearch( 5, 15, 30 );
        assertTrue( "index: " + index, index < 0 );

        try {
            a.binarySearch( 5, 10, 55 );
            fail( "Expected ArrayIndexOutOfBoundsException" );
View Full Code Here

Examples of gnu.trove.list.TIntList.binarySearch()

        // Not in this range.
        index = a.binarySearch( 5, 15, 30 );
        assertTrue( "index: " + index, index < 0 );

        try {
            a.binarySearch( 5, 10, 55 );
            fail( "Expected ArrayIndexOutOfBoundsException" );
        }
        catch ( ArrayIndexOutOfBoundsException ex ) {
            // Expected
        }
View Full Code Here

Examples of gnu.trove.list.TIntList.binarySearch()

        catch ( ArrayIndexOutOfBoundsException ex ) {
            // Expected
        }

        try {
            a.binarySearch( 5, -1, 15 );
            fail( "Expected ArrayIndexOutOfBoundsException" );
        }
        catch ( ArrayIndexOutOfBoundsException ex ) {
            // Expected
        }
View Full Code Here

Examples of gnu.trove.list.TIntList.binarySearch()

                System.out.print(" ");
            }

            list = new TIntArrayList(i);
            list.add(5);
            list.binarySearch(6);
        }

        list = new TIntArrayList();
        list.add(5);
View Full Code Here

Examples of gnu.trove.list.TIntList.binarySearch()

        }

        list = new TIntArrayList();
        list.add(5);

        assertEquals(-1, list.binarySearch(Integer.MIN_VALUE));
        assertEquals(-1, list.binarySearch(-1));
        assertEquals(-1, list.binarySearch(0));
        assertEquals(-1, list.binarySearch(1));
        assertEquals(-1, list.binarySearch(2));
        assertEquals(-1, list.binarySearch(3));
View Full Code Here

Examples of gnu.trove.list.TIntList.binarySearch()

        list = new TIntArrayList();
        list.add(5);

        assertEquals(-1, list.binarySearch(Integer.MIN_VALUE));
        assertEquals(-1, list.binarySearch(-1));
        assertEquals(-1, list.binarySearch(0));
        assertEquals(-1, list.binarySearch(1));
        assertEquals(-1, list.binarySearch(2));
        assertEquals(-1, list.binarySearch(3));
        assertEquals(-1, list.binarySearch(4));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.