private void getInertIndex ( HashMap event ) { int iDate ; try { iDate = Integer . parseInt ( getValueOr ( event , "date" , "" ) ) ; } catch ( Exception e ) { next = events . size ( ) ; return ; } for ( int i = isEventExist ( ) ? next : 0 ; i < events . size ( ) ; i ++ ) { try { if ( iDate < Integer . parseInt ( getValueOr ( events . get ( i ) , "date" , "0" ) ) ) { next = i ; return ; } } catch ( Exception e ) { } } next = events . size ( ) ; }
Find out the insert position for the new event . If date is not available for the new event will return the last position of array