Examples of removeAt()


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

        }

        // Can't remove again from THIS list because it's not present.
        assertFalse( a.remove( 5 ) );

        assertEquals( 6, a.removeAt( 4 ) );
        for ( int i = 0; i < 4; i++ ) {
            int expected = i + 1;
            assertTrue( "index " + i + " expected " + expected, a.get( i ) == expected );
        }
        for ( int i = 4; i < a.size(); i++ ) {
View Full Code Here

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

        }

        // Remove odd offsets, which are even numbers.
        for ( int i = element_count; i >= 0; i-- ) {
            if ( i % 2 == 1 ) {
                a.removeAt( i );
            }
        }

        for ( int i = 0; i < a.size(); i++ ) {
            int expected = i * 2 + 1;
View Full Code Here

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

        }

        // Remove odd offsets, which are even numbers.
        for ( int i = element_count; i >= 0; i-- ) {
            if ( i % 2 == 1 ) {
                a.removeAt( i );
            }
        }

        for ( int i = 0; i < a.size(); i++ ) {
            int expected = i * 2 + 1;
View Full Code Here

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

        }

        // Can't remove again from THIS list because it's not present.
        assertFalse( a.remove( 5 ) );

        assertEquals( 6, a.removeAt( 4 ) );
        for ( int i = 0; i < 4; i++ ) {
            int expected = i + 1;
            assertTrue( "index " + i + " expected " + expected, a.get( i ) == expected );
        }
        for ( int i = 4; i < a.size(); i++ ) {
View Full Code Here

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

        }

        // Remove odd offsets, which are even numbers.
        for ( int i = element_count; i >= 0; i-- ) {
            if ( i % 2 == 1 ) {
                a.removeAt( i );
            }
        }

        for ( int i = 0; i < a.size(); i++ ) {
            int expected = i * 2 + 1;
View Full Code Here

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

        assertEquals(1, list.sum());

        list.add(1234);
        assertEquals(1235, list.sum());

        list.removeAt(0);
        assertEquals(1234, list.sum());

        list.clear();
        assertEquals(0, list.sum());
    }
View Full Code Here

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

    assertEquals( 1, list.sum() );

    list.add( 1234 );
    assertEquals( 1235, list.sum() );

    list.removeAt( 0 );
    assertEquals( 1234, list.sum() );

    list.clear();
    assertEquals( 0, list.sum() );
  }
View Full Code Here

Examples of gnu.trove.list.array.TIntArrayList.removeAt()

    assertEquals( Integer.valueOf( 3 ), wrapped_list.get( 1 ) );
    assertEquals( Integer.valueOf( 4 ), wrapped_list.get( 2 ) );
    assertEquals( Integer.valueOf( 5 ), wrapped_list.get( 3 ) );
    assertEquals( Integer.valueOf( 6 ), wrapped_list.get( 4 ) );

    list.removeAt( 1 );

    assertEquals( 4, list.size() );
    assertEquals( Integer.valueOf( 2 ), wrapped_list.get( 0 ) );
    assertEquals( Integer.valueOf( 4 ), wrapped_list.get( 1 ) );
    assertEquals( Integer.valueOf( 5 ), wrapped_list.get( 2 ) );
View Full Code Here

Examples of gnu.trove.list.array.TIntArrayList.removeAt()

      fromOutList.resetQuick();
    } else {
      int index = this.getNeighborIx(from, to);
      // switch the out edge in the list
      fromOutList.set(index, fromOutList.get(fromOutList.size() - 1));
      fromOutList.removeAt(index);

      // change the incoming edge index in the new node in the old
      // position
      final TIntArrayList toInList = this.inAdjLists.get(fromOutList
          .get(index));
View Full Code Here

Examples of gnu.trove.list.array.TIntArrayList.removeAt()

      toInList.set(index, toInList.get(toInList.size() - 1));
      toInIndexList.set(index,
          toInIndexList.get(toInIndexList.size() - 1));
      // remove the last location
      toInList.removeAt(toInList.size() - 1);
      toInIndexList.removeAt(toInIndexList.size() - 1);
    }
  }

  /**
   * Returns the number of nodes in the graph
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.