public void updateUniqueCounters ( ) { // // Update task unique IDs // for ( Task task : m_parent . getTasks ( ) ) { int uniqueID = NumberHelper . getInt ( task . getUniqueID ( ) ) ; if ( uniqueID > m_taskUniqueID ) { m_taskUniqueID = uniqueID ; } } // // Update resource unique IDs // for ( Resource resource : m_parent . getResources ( ) ) { int uniqueID = NumberHelper . getInt ( resource . getUniqueID ( ) ) ; if ( uniqueID > m_resourceUniqueID ) { m_resourceUniqueID = uniqueID ; } } // // Update calendar unique IDs // for ( ProjectCalendar calendar : m_parent . getCalendars ( ) ) { int uniqueID = NumberHelper . getInt ( calendar . getUniqueID ( ) ) ; if ( uniqueID > m_calendarUniqueID ) { m_calendarUniqueID = uniqueID ; } } // // Update assignment unique IDs // for ( ResourceAssignment assignment : m_parent . getResourceAssignments ( ) ) { int uniqueID = NumberHelper . getInt ( assignment . getUniqueID ( ) ) ; if ( uniqueID > m_assignmentUniqueID ) { m_assignmentUniqueID = uniqueID ; } } }
This method is called to ensure that after a project file has been read the cached unique ID values used to generate new unique IDs start after the end of the existing set of unique IDs .