Package gnu.trove.list

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


        collection.add( 1138 );
        assertFalse( list.equals( collection ) );

        TIntList other = new TIntLinkedList( list );
        other.replace( 10, 1138 );
        assertFalse( list.equals( other ) );
    }


    public void testSerialization() throws Exception {
View Full Code Here


        collection.add( 1138 );
        assertFalse( list.equals( collection ) );

        TIntList other = new TIntArrayList( list );
        other.replace( 10, 1138 );
        assertFalse( list.equals( other ) );
    }


    public void testSerialization() throws Exception {
View Full Code Here

        for ( int i = 1; i <= element_count; i++ ) {
            a.add( i );
        }

        int testval = 1138;
        assertEquals( 6, a.replace( 5, testval ) );

        for ( int i = 0; i < 5; i++ ) {
            int result = a.get( i );
            int expected = i + 1;
            assertTrue( "element " + result + " should be " + expected,
View Full Code Here

            assertTrue( "element " + result + " should be " + expected,
                    result == expected );
        }

        try {
            a.replace( 100, 20 );
            fail( "Expected IndexOutOfBoundsException" );
        }
        catch ( IndexOutOfBoundsException ex ) {
            // Expected
        }
View Full Code Here

        for ( int i = 1; i <= element_count; i++ ) {
            a.add( i );
        }

        int testval = 1138;
        assertEquals( 6, a.replace( 5, testval ) );

        for ( int i = 0; i < 5; i++ ) {
            int result = a.get( i );
            int expected = i + 1;
            assertTrue( "element " + result + " should be " + expected,
View Full Code Here

            assertTrue( "element " + result + " should be " + expected,
                    result == expected );
        }

        try {
            a.replace( 100, 20 );
            fail( "Expected IndexOutOfBoundsException" );
        }
        catch ( IndexOutOfBoundsException ex ) {
            // Expected
        }
View Full Code Here

        for ( int i = 1; i <= element_count; i++ ) {
            a.add( i );
        }

        int testval = 1138;
        assertEquals( 6, a.replace( 5, testval ) );

        for ( int i = 0; i < 5; i++ ) {
            int result = a.get( i );
            int expected = i + 1;
            assertTrue( "element " + result + " should be " + expected,
View Full Code Here

            assertTrue( "element " + result + " should be " + expected,
                    result == expected );
        }

        try {
            a.replace( 100, 20 );
            fail( "Expected IndexOutOfBoundsException" );
        }
        catch ( IndexOutOfBoundsException ex ) {
            // Expected
        }
View Full Code Here

        collection.add( 1138 );
        assertFalse( list.equals( collection ) );

        TIntList other = new TIntArrayList( list );
        other.replace( 10, 1138 );
        assertFalse( list.equals( other ) );
    }


    public void testSerialization() throws Exception {
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.