public Integer extractArchiveDateCount ( String datePattern ) { int dateCount = 0 ; String [ ] splits = datePattern . split ( "d|M|y" ) ; if ( splits . length > 0 ) { dateCount = dateCount + Integer . valueOf ( splits [ 0 ] ) ; } if ( splits . length > 1 ) { dateCount = dateCount + ( Integer . valueOf ( splits [ 1 ] ) * 30 ) ; } if ( splits . length > 2 ) { dateCount = dateCount + ( Integer . valueOf ( splits [ 2 ] ) * 365 ) ; } return dateCount ; }
Extract archive date count .