private static void addMinistryPerYearToMap ( final String name , final Map < Integer , List < GovernmentBodyAnnualSummary > > map , final HSSFSheet mySheet ) { if ( mySheet . getSheetName ( ) . chars ( ) . allMatch ( Character :: isDigit ) ) { final int year = Integer . parseInt ( mySheet . getSheetName ( ) ) ; final List < GovernmentBodyAnnualSummary > yearList = new ArrayList <> ( ) ; final Iterator < Row > rowIterator = mySheet . iterator ( ) ; // Skip header row, ignore first rowIterator . next ( ) ; while ( rowIterator . hasNext ( ) ) { addGovernmentBodyAnnualSummaryToList ( name , year , yearList , rowIterator . next ( ) ) ; } map . put ( year , yearList ) ; } }
Adds the ministry per year to map .