Google Data APIs Client Library (1.41.1)



com.google.gdata.data.extensions
Class Rating

java.lang.Object
  extended by com.google.gdata.data.AbstractExtension
      extended by com.google.gdata.data.ExtensionPoint
          extended by com.google.gdata.data.extensions.Rating
All Implemented Interfaces:
Extension

public class Rating
extends ExtensionPoint

GData schema extension describing an object's rating.


Nested Class Summary
static class Rating.Rel
          Rating type.
 
Nested classes/interfaces inherited from class com.google.gdata.data.ExtensionPoint
ExtensionPoint.CumulativeBlobHandler, ExtensionPoint.ExtensionHandler
 
Nested classes/interfaces inherited from class com.google.gdata.data.AbstractExtension
AbstractExtension.AttributesHandler
 
Field Summary
protected  java.lang.Float average
          Average ratings, output with a fixed a 2 digit precision.
protected  java.lang.Integer max
          Maximum rating value on rating scale (optional).
protected  java.lang.Integer min
          Minimum rating value on rating scale (optional).
protected  java.lang.Integer numRaters
          Number of ratings that was taken into account (for average ratings).
protected  java.lang.Integer rating
          Rating value (required).
protected  java.lang.String rel
          Rating type.
 
Fields inherited from class com.google.gdata.data.ExtensionPoint
xmlBlob
 
Fields inherited from class com.google.gdata.data.AbstractExtension
localName, namespace
 
Constructor Summary
Rating()
          Constructs an empty Rating.
Rating(java.lang.Integer rating)
          Constructs a Rating class with a specified rating.
 
Method Summary
 void generate(com.google.gdata.util.common.xml.XmlWriter w, ExtensionProfile extProfile)
          Generates an XML representation for the extension.
 java.lang.Float getAverage()
           
static ExtensionDescription getDefaultDescription()
          Returns the suggested extension description and is repeatable.
static ExtensionDescription getDefaultDescription(boolean repeatable)
          Returns the suggested extension description with configurable repeatability.
 XmlParser.ElementHandler getHandler(ExtensionProfile extProfile, java.lang.String namespace, java.lang.String localName, org.xml.sax.Attributes attrs)
          The default implementation uses the AbstractExtension.AttributesHandler to handle parsing the extension.
 java.lang.Integer getMax()
           
 java.lang.Integer getMin()
           
 java.lang.Integer getNumRaters()
           
 java.lang.String getRel()
           
 java.lang.Integer getValue()
           
 void setAverage(java.lang.Float r)
           
 void setMax(java.lang.Integer r)
           
 void setMin(java.lang.Integer r)
           
 void setNumRaters(java.lang.Integer r)
           
 void setRel(java.lang.String v)
           
 void setValue(java.lang.Integer r)
           
 
Methods inherited from class com.google.gdata.data.ExtensionPoint
addExtension, addExtension, addRepeatingExtension, addRepeatingExtension, checkRequiredExtensions, createExtensionInstance, declareExtensions, generate, generateCumulativeXmlBlob, generateExtensions, generateStartElement, getExtension, getExtensionDescription, getExtensionHandler, getExtensions, getManifest, getRepeatingExtension, getRepeatingExtensions, getXmlBlob, hasExtension, hasRepeatingExtension, initializeArbitraryXml, parseCumulativeXmlBlob, removeExtension, removeExtension, removeRepeatingExtension, setExtension, setXmlBlob, visit, visitChild, visitChildren
 
Methods inherited from class com.google.gdata.data.AbstractExtension
consumeAttributes, disableStrictValidation, enableStrictValidation, eq, generateAttributes, getExtensionLocalName, getExtensionNamespace, isImmutable, isStrictValidation, putAttributes, sameClassAs, setImmutable, throwExceptionForMissingAttribute, throwExceptionIfImmutable, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rel

protected java.lang.String rel
Rating type.


rating

protected java.lang.Integer rating
Rating value (required).


min

protected java.lang.Integer min
Minimum rating value on rating scale (optional).


max

protected java.lang.Integer max
Maximum rating value on rating scale (optional).


numRaters

protected java.lang.Integer numRaters
Number of ratings that was taken into account (for average ratings).


average

protected java.lang.Float average
Average ratings, output with a fixed a 2 digit precision.

Constructor Detail

Rating

public Rating()
Constructs an empty Rating.


Rating

public Rating(java.lang.Integer rating)
Constructs a Rating class with a specified rating.

Parameters:
rating - the value of the rating
Method Detail

getRel

public java.lang.String getRel()

setRel

public void setRel(java.lang.String v)

getValue

public java.lang.Integer getValue()

setValue

public void setValue(java.lang.Integer r)

getMin

public java.lang.Integer getMin()

setMin

public void setMin(java.lang.Integer r)

getMax

public java.lang.Integer getMax()

setMax

public void setMax(java.lang.Integer r)

getNumRaters

public java.lang.Integer getNumRaters()

setNumRaters

public void setNumRaters(java.lang.Integer r)

getAverage

public java.lang.Float getAverage()

setAverage

public void setAverage(java.lang.Float r)

getDefaultDescription

public static ExtensionDescription getDefaultDescription(boolean repeatable)
Returns the suggested extension description with configurable repeatability.


getDefaultDescription

public static ExtensionDescription getDefaultDescription()
Returns the suggested extension description and is repeatable.


generate

public void generate(com.google.gdata.util.common.xml.XmlWriter w,
                     ExtensionProfile extProfile)
              throws java.io.IOException
Description copied from interface: Extension
Generates an XML representation for the extension.

Specified by:
generate in interface Extension
Overrides:
generate in class AbstractExtension
Parameters:
w - XML writer
extProfile - extension profile
Throws:
java.io.IOException

getHandler

public XmlParser.ElementHandler getHandler(ExtensionProfile extProfile,
                                           java.lang.String namespace,
                                           java.lang.String localName,
                                           org.xml.sax.Attributes attrs)
Description copied from class: AbstractExtension
The default implementation uses the AbstractExtension.AttributesHandler to handle parsing the extension.

Specified by:
getHandler in interface Extension
Overrides:
getHandler in class ExtensionPoint
Parameters:
extProfile - extension profile
namespace - extension namespace
localName - tag name, without the namespace prefix
attrs - tag attributes
Returns:
an element handler