org.lenskit.data.ratings

## Class RatingMatrixEntry

• All Implemented Interfaces:
Preference

public abstract class RatingMatrixEntry
extends Object
implements Preference

An entry in a RatingMatrix. This is like a Rating, but:

• It has 0-based indexes for the user, item, and itself.
• It does not have a timestamp, and is not an event.
• ### Constructor Summary

Constructors
Constructor and Description
RatingMatrixEntry()
• ### Method Summary

All Methods
Modifier and Type Method and Description
abstract int getIndex()
Get the index of this rating in the list of ratings in the matrix.
abstract long getItemId()
Get the item ID for this rating matrix entry.
abstract int getItemIndex()
Get the 0-based item index for this rating matrix entry.
abstract long getUserId()
Get the user ID for this rating matrix entry.
abstract int getUserIndex()
Get the 0-based user index for this rating matrix entry.
abstract double getValue()
Get the value of this rating matrix entry.
String toString()
• ### Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
• ### Constructor Detail

• #### RatingMatrixEntry

public RatingMatrixEntry()
• ### Method Detail

• #### getUserId

public abstract long getUserId()

Get the user ID for this rating matrix entry.

Specified by:
getUserId in interface Preference
Returns:
The entry’s user ID.
• #### getUserIndex

public abstract int getUserIndex()

Get the 0-based user index for this rating matrix entry.

Returns:
The entry’s user index. This will correspond to the user’s ID in the RatingMatrix.userIndex() of the rating matrix from which this entry came.
• #### getItemId

public abstract long getItemId()

Get the item ID for this rating matrix entry.

Specified by:
getItemId in interface Preference
Returns:
The entry’s item ID.
• #### getItemIndex

public abstract int getItemIndex()

Get the 0-based item index for this rating matrix entry.

Returns:
The entry’s item index. This will correspond to the item’s ID in the RatingMatrix.itemIndex() of the rating matrix from which this entry came.
• #### getIndex

public abstract int getIndex()

Get the index of this rating in the list of ratings in the matrix.

Returns:
The 0-based index of the rating.
• #### getValue

public abstract double getValue()

Get the value of this rating matrix entry.

Specified by:
getValue in interface Preference
Returns:
The rating value.
• #### toString

public String toString()
Overrides:
toString in class Object