long userID = Long.parseLong(tokens[0]);
int ratingsLeftToRead = Integer.parseInt(tokens[1]);
int ratingsRead = 0;
PreferenceArray currentUserPrefs = new GenericUserPreferenceArray(ratingsLeftToRead);
long[] timestamps = new long[ratingsLeftToRead];
while (ratingsLeftToRead > 0) {
line = lineIterator.next();
// Then a data line. May be 1-4 tokens depending on whether preference info is included (it's not in test data)
// or whether date info is included (not inluded in track 2). Item ID is always first, and date is the last
// two fields if it exists.
tokens = TAB_PATTERN.split(line);
boolean hasPref = tokens.length == 2 || tokens.length == 4;
boolean hasDate = tokens.length > 2;
long itemID = Long.parseLong(tokens[0]);
currentUserPrefs.setUserID(0, userID);
currentUserPrefs.setItemID(ratingsRead, itemID);
if (hasPref) {
float preference = Float.parseFloat(tokens[1]);
currentUserPrefs.setValue(ratingsRead, preference);
}
if (hasDate) {
long timestamp;
if (hasPref) {