org.mymedialite.io
Class StaticRatingData

java.lang.Object
  extended by org.mymedialite.io.StaticRatingData

public class StaticRatingData
extends java.lang.Object

Class that offers methods for reading in static rating data.


Method Summary
static IRatings read(java.io.BufferedReader reader, int size, IEntityMapping user_mapping, IEntityMapping item_mapping, RatingType rating_type, boolean ignore_first_line)
          Read in static rating data from a TextReader.
static IRatings read(java.lang.String filename, IEntityMapping user_mapping, IEntityMapping item_mapping, RatingType rating_type, boolean ignore_first_line)
          Read in static rating data from a file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

read

public static IRatings read(java.lang.String filename,
                            IEntityMapping user_mapping,
                            IEntityMapping item_mapping,
                            RatingType rating_type,
                            boolean ignore_first_line)
                     throws java.io.IOException
Read in static rating data from a file.

Parameters:
filename - the name of the file to read from
user_mapping - mapping object for user IDs
item_mapping - mapping object for item IDs
rating_type - the data type to be used for storing the ratings
ignore_first_line - if true, ignore the first line
Returns:
the rating data
Throws:
java.io.IOException

read

public static IRatings read(java.io.BufferedReader reader,
                            int size,
                            IEntityMapping user_mapping,
                            IEntityMapping item_mapping,
                            RatingType rating_type,
                            boolean ignore_first_line)
                     throws java.io.IOException
Read in static rating data from a TextReader.

Parameters:
reader - the to read from
size - the number of ratings in the file
user_mapping - mapping object for user IDs
item_mapping - mapping object for item IDs
rating_type - the data type to be used for storing the ratings
ignore_first_line - if true, ignore the first line
Returns:
the rating data
Throws:
java.io.IOException