org.mymedialite.io
Class RatingData
java.lang.Object
org.mymedialite.io.RatingData
public class RatingData
- extends java.lang.Object
Class that offers methods for reading in rating data
Method Summary |
static IRatings |
read(java.io.BufferedReader reader,
IEntityMapping userMapping,
IEntityMapping itemMapping,
boolean ignoreFirstLine)
Read in rating data from a BufferedReader
Each line must consist of at least three fields, the first being a user identifier, the second being
an item identifier and the third being a rating value. |
static IRatings |
read(java.lang.String filename,
IEntityMapping userMapping,
IEntityMapping itemMapping,
boolean ignoreFirstLine)
Read in rating data from a file. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RatingData
public RatingData()
read
public static IRatings read(java.lang.String filename,
IEntityMapping userMapping,
IEntityMapping itemMapping,
boolean ignoreFirstLine)
throws java.io.IOException,
java.lang.NumberFormatException
- Read in rating data from a file.
Each line must consist of at least three fields, the first being a user identifier, the second being
an item identifier and the third being a rating value. Additional fields and empty lines are ignored.
See Constants.SPLIT_CHARS for details of the permissible field separators.
- Parameters:
filename
- the name of the file to read fromuserMapping
- mapping object for user IDsitemMapping
- mapping object for item IDsignoreFirstLine
- if true, ignore the first line
- Returns:
- the rating data
- Throws:
java.io.IOException
java.lang.NumberFormatException
read
public static IRatings read(java.io.BufferedReader reader,
IEntityMapping userMapping,
IEntityMapping itemMapping,
boolean ignoreFirstLine)
throws java.io.IOException,
java.lang.NumberFormatException
- Read in rating data from a BufferedReader
Each line must consist of at least three fields, the first being a user identifier, the second being
an item identifier and the third being a rating value. Additional fields and empty lines are ignored.
See Constants.SPLIT_CHARS for details of the permissible field separators.
- Parameters:
reader
- the BufferedReader to read fromuserMapping
- mapping object for user IDsitemMapping
- mapping object for item IDsignoreFirstLine
- if true, ignore the first line
- Returns:
- the rating data
- Throws:
java.io.IOException
java.lang.NumberFormatException