public class MutableRating extends Object implements Rating
DelimitedTextRatingCursor
and similar places.Constructor and Description |
---|
MutableRating() |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
long |
getItemId()
Get the item ID.
|
Preference |
getPreference()
Get the expressed preference.
|
long |
getTimestamp()
Get the event timestamp.
|
long |
getUserId()
Get the ID of the user responsible for the event.
|
double |
getValue()
Get the value rating.
|
int |
hashCode() |
boolean |
hasValue()
Query whether this rating has a value.
|
void |
setItemId(long iid)
Set the rating's new item ID.
|
void |
setRating(double v)
Set the rating value.
|
void |
setTimestamp(long ts)
Set the rating's new timestamp.
|
void |
setUserId(long uid)
Set the rating's user ID.
|
String |
toString() |
public final boolean hasValue()
Rating
public final double getValue() throws IllegalStateException
Rating
getValue
in interface Rating
IllegalStateException
public long getUserId()
Event
public void setUserId(long uid)
uid
- The new user ID.public long getItemId()
Event
public void setItemId(long iid)
iid
- The new item ID.public Preference getPreference()
Rating
null
.getPreference
in interface Rating
public void setRating(double v)
Double.NaN
indicates an unrate
event.v
- The rating value.public long getTimestamp()
Event
getTimestamp
in interface Event
public void setTimestamp(long ts)
ts
- The rating's timestamp.