comp1110-ass2/tests/comp1110/ass2/testdata/TotalIslandsScoreDataLoader.java
2023-03-22 14:26:58 +11:00

26 lines
628 B
Java

package comp1110.ass2.testdata;
import java.util.ArrayList;
import java.util.List;
public class TotalIslandsScoreDataLoader extends DataLoader<List<Integer>> {
public TotalIslandsScoreDataLoader(){
super();
}
@Override
protected List<Integer> processLine(String line) {
line = line.substring(1, line.length() - 1);
List<Integer> score = new ArrayList<>();
for(String s : line.split(", ")){
score.add(Integer.parseInt(s));
}
return score;
}
@Override
protected String getFileName() {
return "calculateTotalIslandsScore";
}
}