List<RoomHardConstraint> roomHardConstraintList = new ArrayList<RoomHardConstraint>();
String line = bufferedReader.readLine();
int id = 0;
while (!line.equals("[InstitutionalWeightings]")) {
String[] lineTokens = line.split(SPLIT_REGEX);
RoomHardConstraint roomHardConstraint = new RoomHardConstraint();
roomHardConstraint.setId((long) id);
if (lineTokens.length != 2) {
throw new IllegalArgumentException("Read line (" + line + ") is expected to contain 3 tokens.");
}
roomHardConstraint.setTopic(topicList.get(Integer.parseInt(lineTokens[0])));
roomHardConstraint.setRoomHardConstraintType(RoomHardConstraintType.valueOf(lineTokens[1]));
roomHardConstraintList.add(roomHardConstraint);
line = bufferedReader.readLine();
id++;
}
examination.setRoomHardConstraintList(roomHardConstraintList);