public void renumberIDs ( ) { if ( ! isEmpty ( ) ) { Collections . sort ( this ) ; T firstEntity = get ( 0 ) ; int id = NumberHelper . getInt ( firstEntity . getID ( ) ) ; if ( id != 0 ) { id = 1 ; } for ( T entity : this ) { entity . setID ( Integer . valueOf ( id ++ ) ) ; } } }
This method can be called to ensure that the IDs of all entities are sequential and start from an appropriate point . If entities are added to and removed from this list then the project is loaded into Microsoft project if the ID values have gaps in the sequence there will be blank rows shown .