|
CFEngine API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.recommender.server.RatingArrays
Field Summary | |
int[] |
ids
Array of ids |
float[] |
ratings
Array of ratings for ids in corresponding index in ids[] |
Constructor Summary | |
RatingArrays(int size)
Constructor for RatingArrays |
|
RatingArrays(int[] ids,
float[] ratings)
Constructor for RatingArrays Note: arrays must be full of ids and ratings who's indexes correspond. |
|
RatingArrays(int[] ids,
float[] ratings,
int incrementSize)
Constructor for RatingArrays Note: arrays must be full of ids and ratings who's indexes correspond. |
|
RatingArrays(int size,
int incrementSize)
Constructor for RatingArrays |
Method Summary | |
void |
addRating(int id,
float rating)
Add rating to arrays |
boolean |
containsKey(int id)
Returns if array has key |
int[] |
getIds()
Array of ids. |
int |
getIncrementSize()
Size the arrays will increase once they reach threshold |
ItemRating[] |
getItemRatingsArray()
Returns an array of itemratings corresponding to the values cached; |
int |
getLength()
Returns the total number of valid elements in the array. |
float |
getRating(int id)
Gets cached rating. |
float[] |
getRatings()
Array of ratings. |
java.util.LinkedList |
getRatingsList()
Builds a linkedlist of ItemRatings corresponding to values in the array |
void |
removeRating(int id)
Remove rating from arrays |
void |
setIncrementSize(int incrementSize)
Size the arrays will increase once they reach threshold |
java.lang.String |
toString()
Prints out the arrays. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public int[] ids
public float[] ratings
Constructor Detail |
public RatingArrays(int size)
size
- initial number of ratings to be storedpublic RatingArrays(int[] ids, float[] ratings)
ids
- array containing idsratings
- array of ratings corresponding to idspublic RatingArrays(int size, int incrementSize)
size
- initial number of ratings to be storedincrementSize
- amount to increment array size by when it passes threshholdpublic RatingArrays(int[] ids, float[] ratings, int incrementSize)
ids
- array containing idsratings
- array of ratings corresponding to idsincrementSize
- amount to increment array size by when it passes threshholdMethod Detail |
public void addRating(int id, float rating)
id
- rating
- public void removeRating(int id)
id
- public float getRating(int id)
id
-
public int[] getIds()
int getLength()
public float[] getRatings()
int getLength()
public int getLength()
public int getIncrementSize()
public void setIncrementSize(int incrementSize)
incrementSize
- public java.lang.String toString()
toString
in class java.lang.Object
public java.util.LinkedList getRatingsList()
public ItemRating[] getItemRatingsArray()
public boolean containsKey(int id)
id
-
|
CFEngine API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |