for (String line : new FileLineIterable(movieFile, true)) {
int firstComma = line.indexOf(',');
Integer userID = Integer.valueOf(line.substring(0, firstComma));
int secondComma = line.indexOf(',', firstComma + 1);
float rating = Float.parseFloat(line.substring(firstComma + 1, secondComma));
prefs.add(new GenericPreference(userID, itemID, rating));
}
} catch (IOException ioe) {
throw new TasteException(ioe);
}
return new GenericItemPreferenceArray(prefs);