}
return Integer.parseInt(line.substring(header.length() + 2, line.length() - 1));
}
private void readInstitutionalWeighting(Examination examination) throws IOException {
InstitutionalWeighting institutionalWeighting = new InstitutionalWeighting();
institutionalWeighting.setId(0L);
String[] lineTokens;
lineTokens = readInstitutionalWeightingProperty("TWOINAROW", 2);
institutionalWeighting.setTwoInARowPenality(Integer.parseInt(lineTokens[1]));
lineTokens = readInstitutionalWeightingProperty("TWOINADAY", 2);
institutionalWeighting.setTwoInADayPenality(Integer.parseInt(lineTokens[1]));
lineTokens = readInstitutionalWeightingProperty("PERIODSPREAD", 2);
institutionalWeighting.setPeriodSpreadLength(Integer.parseInt(lineTokens[1]));
institutionalWeighting.setPeriodSpreadPenality(1); // constant
lineTokens = readInstitutionalWeightingProperty("NONMIXEDDURATIONS", 2);
institutionalWeighting.setMixedDurationPenality(Integer.parseInt(lineTokens[1]));
lineTokens = readInstitutionalWeightingProperty("FRONTLOAD", 4);
institutionalWeighting.setFrontLoadLargeTopicSize(Integer.parseInt(lineTokens[1]));
institutionalWeighting.setFrontLoadLastPeriodSize(Integer.parseInt(lineTokens[2]));
institutionalWeighting.setFrontLoadPenality(Integer.parseInt(lineTokens[3]));
examination.setInstitutionalWeighting(institutionalWeighting);
}