com.google.gdata.model.gd
Class Rating

java.lang.Object
  extended by com.google.gdata.model.Element
      extended by com.google.gdata.model.gd.Rating

public class Rating
extends Element

Describes a rating.


Nested Class Summary
static class Rating.Rel
          Programmatic value that describes the aspect that's being rated, if not specified, the rating is an overall rating.
 
Field Summary
static AttributeKey<java.lang.Float> AVERAGE
          Average rating.
static ElementKey<java.lang.Void,Rating> KEY
          The key for this element.
static AttributeKey<java.lang.Integer> MAX
          Rating scale's maximum value.
static AttributeKey<java.lang.Integer> MIN
          Rating scale's minimum value.
static AttributeKey<java.lang.Integer> NUM_RATERS
          Number of ratings taken into account when computing the average value.
static AttributeKey<java.lang.String> REL
          Programmatic value that describes the aspect that's being rated, if not specified, the rating is an overall rating.
static AttributeKey<java.lang.Integer> VALUE
          Rating value.
 
Constructor Summary
Rating()
          Constructs an instance using the default key.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.lang.Float getAverage()
          Returns the average rating.
 java.lang.Integer getMax()
          Returns the rating scale's maximum value.
 java.lang.Integer getMin()
          Returns the rating scale's minimum value.
 java.lang.Integer getNumRaters()
          Returns the number of ratings taken into account when computing the average value.
 java.lang.String getRel()
          Returns the programmatic value that describes the aspect that's being rated, if not specified, the rating is an overall rating.
 java.lang.Integer getValue()
          Returns the rating value.
 boolean hasAverage()
          Returns whether it has the average rating.
 int hashCode()
           
 boolean hasMax()
          Returns whether it has the rating scale's maximum value.
 boolean hasMin()
          Returns whether it has the rating scale's minimum value.
 boolean hasNumRaters()
          Returns whether it has the number of ratings taken into account when computing the average value.
 boolean hasRel()
          Returns whether it has the programmatic value that describes the aspect that's being rated, if not specified, the rating is an overall rating.
 boolean hasValue()
          Returns whether it has the rating value.
 Rating lock()
          Locks this element.
static void registerMetadata(MetadataRegistry registry)
          Registers the metadata for this element.
 Rating setAverage(java.lang.Float average)
          Sets the average rating.
 Rating setMax(java.lang.Integer max)
          Sets the rating scale's maximum value.
 Rating setMin(java.lang.Integer min)
          Sets the rating scale's minimum value.
 Rating setNumRaters(java.lang.Integer numRaters)
          Sets the number of ratings taken into account when computing the average value.
 Rating setRel(java.lang.String rel)
          Sets the programmatic value that describes the aspect that's being rated, if not specified, the rating is an overall rating.
 Rating setValue(java.lang.Integer value)
          Sets the rating value.
 
Methods inherited from class com.google.gdata.model.Element
addElement, addElement, addElement, clear, createElement, createElement, getAttributeCount, getAttributeIterator, getAttributeIterator, getAttributeValue, getAttributeValue, getDefaultKey, getElement, getElement, getElementCount, getElementId, getElementIterator, getElementIterator, getElementKey, getElements, getElements, getElementSet, getElementSet, getElementValue, getElementValue, getTextValue, getTextValue, hasAttribute, hasAttribute, hasElement, hasElement, hasTextValue, isLocked, removeAttribute, removeAttribute, removeAttributeValue, removeAttributeValue, removeElement, removeElement, removeElement, removeElement, replaceElement, resolve, resolve, setAttributeValue, setAttributeValue, setElement, setElement, setElement, setTextValue, toString, visit
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

KEY

public static final ElementKey<java.lang.Void,Rating> KEY
The key for this element.


AVERAGE

public static final AttributeKey<java.lang.Float> AVERAGE
Average rating.


MAX

public static final AttributeKey<java.lang.Integer> MAX
Rating scale's maximum value.


MIN

public static final AttributeKey<java.lang.Integer> MIN
Rating scale's minimum value.


NUM_RATERS

public static final AttributeKey<java.lang.Integer> NUM_RATERS
Number of ratings taken into account when computing the average value.


REL

public static final AttributeKey<java.lang.String> REL
Programmatic value that describes the aspect that's being rated, if not specified, the rating is an overall rating.


VALUE

public static final AttributeKey<java.lang.Integer> VALUE
Rating value.

Constructor Detail

Rating

public Rating()
Constructs an instance using the default key.

Method Detail

registerMetadata

public static void registerMetadata(MetadataRegistry registry)
Registers the metadata for this element.


lock

public Rating lock()
Description copied from class: Element
Locks this element. A locked element cannot have any changes made to its content or its attributes or child elements. This will also lock all attributes and child elements as well. Once this method has been called, this element can be safely published to other threads.

Overrides:
lock in class Element

getAverage

public java.lang.Float getAverage()
Returns the average rating.

Returns:
average rating

setAverage

public Rating setAverage(java.lang.Float average)
Sets the average rating.

Parameters:
average - average rating or null to reset
Returns:
this to enable chaining setters

hasAverage

public boolean hasAverage()
Returns whether it has the average rating.

Returns:
whether it has the average rating

getMax

public java.lang.Integer getMax()
Returns the rating scale's maximum value.

Returns:
rating scale's maximum value

setMax

public Rating setMax(java.lang.Integer max)
Sets the rating scale's maximum value.

Parameters:
max - rating scale's maximum value or null to reset
Returns:
this to enable chaining setters

hasMax

public boolean hasMax()
Returns whether it has the rating scale's maximum value.

Returns:
whether it has the rating scale's maximum value

getMin

public java.lang.Integer getMin()
Returns the rating scale's minimum value.

Returns:
rating scale's minimum value

setMin

public Rating setMin(java.lang.Integer min)
Sets the rating scale's minimum value.

Parameters:
min - rating scale's minimum value or null to reset
Returns:
this to enable chaining setters

hasMin

public boolean hasMin()
Returns whether it has the rating scale's minimum value.

Returns:
whether it has the rating scale's minimum value

getNumRaters

public java.lang.Integer getNumRaters()
Returns the number of ratings taken into account when computing the average value.

Returns:
number of ratings taken into account when computing the average value

setNumRaters

public Rating setNumRaters(java.lang.Integer numRaters)
Sets the number of ratings taken into account when computing the average value.

Parameters:
numRaters - number of ratings taken into account when computing the average value or null to reset
Returns:
this to enable chaining setters

hasNumRaters

public boolean hasNumRaters()
Returns whether it has the number of ratings taken into account when computing the average value.

Returns:
whether it has the number of ratings taken into account when computing the average value

getRel

public java.lang.String getRel()
Returns the programmatic value that describes the aspect that's being rated, if not specified, the rating is an overall rating.

Returns:
programmatic value that describes the aspect that's being rated, if not specified, the rating is an overall rating

setRel

public Rating setRel(java.lang.String rel)
Sets the programmatic value that describes the aspect that's being rated, if not specified, the rating is an overall rating.

Parameters:
rel - programmatic value that describes the aspect that's being rated, if not specified, the rating is an overall rating or null to reset
Returns:
this to enable chaining setters

hasRel

public boolean hasRel()
Returns whether it has the programmatic value that describes the aspect that's being rated, if not specified, the rating is an overall rating.

Returns:
whether it has the programmatic value that describes the aspect that's being rated, if not specified, the rating is an overall rating

getValue

public java.lang.Integer getValue()
Returns the rating value.

Returns:
rating value

setValue

public Rating setValue(java.lang.Integer value)
Sets the rating value.

Parameters:
value - rating value or null to reset
Returns:
this to enable chaining setters

hasValue

public boolean hasValue()
Returns whether it has the rating value.

Returns:
whether it has the rating value

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class Element

hashCode

public int hashCode()
Overrides:
hashCode in class Element