}
private void loadResources(String filename)
throws FileNotFoundException, IOException {
try {
ResourceContainer resources = new ResourceContainer(model);
StringTokenizer tokenizer = this.openFile(filename);
//ignore header fields
tokenizer.nextToken();
tokenizer.nextToken();
while (tokenizer.hasMoreTokens()) {
Resource resource = new Resource();
int id = Integer.parseInt(tokenizer.nextToken());
resource.setId(id);
int fare = Integer.parseInt(tokenizer.nextToken());
resource.setFare(fare);
resources.putResource(id, resource);
}
model.setResourceContainer(resources);
}
catch (FileNotFoundException e) {