comp1110-ass2/tests/comp1110/ass2/testdata/IslandLinksScoreDataLoader.java

27 lines
626 B
Java
Raw Permalink Normal View History

2023-03-22 14:26:58 +11:00
package comp1110.ass2.testdata;
import java.util.ArrayList;
import java.util.List;
public class IslandLinksScoreDataLoader extends DataLoader<List<Integer>> {
public IslandLinksScoreDataLoader(){
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 "calculateIslandLinksScore";
}
}