PercentageRating
public
final
class
PercentageRating
extends Object
implements
Rating
java.lang.Object
|
↳ |
androidx.media2.session.PercentageRating
|
A class for rating expressed as a percentage.
Summary
Public constructors |
PercentageRating()
Creates a unrated PercentageRating instance.
|
PercentageRating(float percent)
Creates a PercentageRating instance with the given percentage.
|
Inherited methods |
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
final
void
|
wait()
|
|
|
Public constructors
PercentageRating
public PercentageRating ()
Creates a unrated PercentageRating instance.
PercentageRating
public PercentageRating (float percent)
Creates a PercentageRating instance with the given percentage.
If percent
is less than 0f or greater than 100f, it will throw
IllegalArgumentException.
Parameters |
percent |
float : the value of the rating
|
Public methods
equals
public boolean equals (Object obj)
getPercentRating
public float getPercentRating ()
Returns the percentage-based rating value.
Returns |
float |
a rating value greater or equal to 0.0f, or a negative value if it is unrated.
|
hashCode
public int hashCode ()
isRated
public boolean isRated ()
Returns whether there is a rating value available.
Returns |
boolean |
true if there is an available rating value.
|
toString
public String toString ()