|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnetflix.algorithms.modelbased.reader.DataReaderFromMem
public class DataReaderFromMem
A DataReader that reads in movies data from a serialized object
| Constructor Summary | |
|---|---|
DataReaderFromMem(MemHelper memHelper)
|
|
| Method Summary | |
|---|---|
void |
close()
Closes and does necessary clean-up |
double |
getAverageMovieRating(int mid)
Gets the average rating for a particular movie |
double |
getAverageRatingForUser(int uid)
Gets the average rating for a user |
java.util.ArrayList<Triple> |
getCommonMovieRatAndAve(int uid1,
int uid2)
Gets all the common movie ratings and average ratings for two users |
java.util.ArrayList<Pair> |
getCommonMovieRatings(int uid1,
int uid2)
Gets the ratings for common movies for two users |
java.util.ArrayList<Triple> |
getCommonUserRatAndAve(int mId1,
int mId2)
Gets the individual and average ratings for common users between two movies |
java.util.ArrayList<Pair> |
getCommonUserRatings(int mId1,
int mId2)
Gets the ratings for common users between two movies |
int |
getNumberOfMovies()
Returns the number of movies |
int |
getNumberOfUsers()
Returns the number of users |
int |
getRating(int uid,
int mid)
Get the rating for a user - movie pair |
int |
getRatingFromComposite(int composite)
Gets the rating from a user-rating or movie-rating block (see movie MemHelper for more information) |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DataReaderFromMem(MemHelper memHelper)
| Method Detail |
|---|
public int getNumberOfUsers()
DataReader
getNumberOfUsers in interface DataReaderpublic int getNumberOfMovies()
DataReader
getNumberOfMovies in interface DataReader
public int getRating(int uid,
int mid)
DataReader
getRating in interface DataReaderuid - User idmid - Movie id
public java.util.ArrayList<Pair> getCommonUserRatings(int mId1,
int mId2)
DataReader
getCommonUserRatings in interface DataReader
public java.util.ArrayList<Triple> getCommonUserRatAndAve(int mId1,
int mId2)
DataReader
getCommonUserRatAndAve in interface DataReaderpublic int getRatingFromComposite(int composite)
DataReader
getRatingFromComposite in interface DataReaderpublic double getAverageMovieRating(int mid)
DataReader
getAverageMovieRating in interface DataReaderpublic void close()
DataReader
close in interface DataReader
public java.util.ArrayList<Pair> getCommonMovieRatings(int uid1,
int uid2)
DataReader
getCommonMovieRatings in interface DataReaderuid1 - - id of one of the usersuid2 - - the other user's id
public double getAverageRatingForUser(int uid)
DataReader
getAverageRatingForUser in interface DataReaderuid - - the id of the user
public java.util.ArrayList<Triple> getCommonMovieRatAndAve(int uid1,
int uid2)
DataReader
getCommonMovieRatAndAve in interface DataReaderuid1 - - id of one of the usersuid2 - - id of the other user
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||