public class RecommendedItemList extends java.lang.Object implements RecommendedList, java.io.Serializable
Constructor and Description |
---|
RecommendedItemList(int maxUserIdxParam)
Constructs an empty list with the specified initial capacity(number of users).
|
RecommendedItemList(int maxUserIdxParam,
int initCapacityParam)
Constructs an empty list with the specified initial capacity(number of users).
|
Modifier and Type | Method and Description |
---|---|
boolean |
addItemIdxList(int userIdx,
java.util.ArrayList<ItemEntry<java.lang.Integer,java.lang.Double>> itemList)
append the specified element to the end of this list.
|
boolean |
addUserItemIdx(int userIdx,
int itemIdx,
double rating)
Appends the specified element to the end of this list.
|
boolean |
contains(int userIdx)
Returns true if this list contains the specified userIdx.
|
java.util.Iterator<UserItemRatingEntry> |
entryIterator()
get the iterator of user-item-rating entry
|
double |
getEntryValue(int userIdx,
int itemIdx)
Deprecated.
|
java.util.List<ItemEntry<java.lang.Integer,java.lang.Double>> |
getItemIdxListByUserIdx(int userIdx)
Returns the itemEntry of user index in this list.
|
int |
getSize()
the number of users (the number of ArrayList)
|
java.util.List<ItemEntry<java.lang.Integer,java.lang.Double>> |
removeUserIdx(int userIdx)
Removes the element at the specified position in this list.
|
boolean |
setItemIdxList(int userIdx,
java.util.List<ItemEntry<java.lang.Integer,java.lang.Double>> itemList)
set the specified element to the end of this list.
|
int |
size()
Returns the number of elements in this list.
|
void |
topNRank(int itemTopN)
top n ranked Items for all userIdx
|
void |
topNRankItemsByUser(int userIdx,
int topN)
top n ranked Items at user userIdx
|
java.util.Iterator<java.lang.Integer> |
userIterator()
get the iterator of user index
|
public RecommendedItemList(int maxUserIdxParam)
maxUserIdxParam
- the max user indexjava.lang.IllegalArgumentException
- if the specified initial capacity is negativepublic RecommendedItemList(int maxUserIdxParam, int initCapacityParam)
maxUserIdxParam
- the max user indexinitCapacityParam
- initial capacityjava.lang.IllegalArgumentException
- if the specified initial capacity is negativepublic boolean setItemIdxList(int userIdx, java.util.List<ItemEntry<java.lang.Integer,java.lang.Double>> itemList)
userIdx
- user indexitemList
- element to be appended to this listCollection.add(E)
)public boolean addItemIdxList(int userIdx, java.util.ArrayList<ItemEntry<java.lang.Integer,java.lang.Double>> itemList)
userIdx
- user indexitemList
- element to be appended to this listCollection.add(E)
)public boolean addUserItemIdx(int userIdx, int itemIdx, double rating)
addUserItemIdx
in interface RecommendedList
userIdx
- user indexitemIdx
- item indexrating
- rating valueCollection.add(E)
)public java.util.List<ItemEntry<java.lang.Integer,java.lang.Double>> getItemIdxListByUserIdx(int userIdx) throws java.lang.IndexOutOfBoundsException
getItemIdxListByUserIdx
in interface RecommendedList
userIdx
- user indexjava.lang.IndexOutOfBoundsException
@Deprecated @LibrecWaring(value="It is best not to use this method! Too slow and the complexity is O(itemIdxList.size()).") public double getEntryValue(int userIdx, int itemIdx) throws java.lang.IndexOutOfBoundsException
getEntryValue
in interface RecommendedList
userIdx
- index of the element to returnitemIdx
- index of the element to returnjava.lang.IndexOutOfBoundsException
public java.util.List<ItemEntry<java.lang.Integer,java.lang.Double>> removeUserIdx(int userIdx) throws java.lang.IndexOutOfBoundsException
removeUserIdx
in interface RecommendedList
userIdx
- user indexjava.lang.IndexOutOfBoundsException
public void topNRank(int itemTopN)
topNRank
in interface RecommendedList
itemTopN
- top n ranked Itemspublic void topNRankItemsByUser(int userIdx, int topN)
topNRankItemsByUser
in interface RecommendedList
userIdx
- user userIdxtopN
- top n ranked Itemspublic boolean contains(int userIdx)
contains
in interface RecommendedList
userIdx
- element whose presence in this list is to be testedpublic int getSize()
public java.util.Iterator<java.lang.Integer> userIterator()
userIterator
in interface RecommendedList
public java.util.Iterator<UserItemRatingEntry> entryIterator()
entryIterator
in interface RecommendedList
public int size()
RecommendedList
size
in interface RecommendedList
Copyright © 2017. All Rights Reserved.