|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.api.gbase.client.AttributeHistogram
public class AttributeHistogram
Histogram information for one attribute, described in
an entry using attributes in the gm: namespace.
Make sure the current feed is an histogram feed and then get the
AttributeHistogram for the entry using:
GoogleBaseEntry.getGoogleBaseMetadata()
.getAttributeHistogram().
Nested Class Summary | |
---|---|
static class |
AttributeHistogram.UniqueValue
A value, as a string, and the number of times the value appears in the result set for the current query. |
Constructor Summary | |
---|---|
AttributeHistogram()
Creates an unitialized AttributeHistogram. |
|
AttributeHistogram(GoogleBaseAttributeId attributeId)
Creates and initializes an AttributeHistogram. |
|
AttributeHistogram(java.lang.String attributeName,
GoogleBaseAttributeType attributeType)
Creates and initializes an AttributeHistogram. |
Method Summary | |
---|---|
void |
addValue(int count,
java.lang.String stringRepresentation)
Adds a new value into the histogram. |
void |
generate(XmlWriter w,
ExtensionProfile extProfile)
Generates the XML representation for this tag. |
GoogleBaseAttributeId |
getAttributeId()
Gets the name and type of the attribute this histogram describes. |
java.lang.String |
getAttributeName()
Gets the name of the attribute this histogram describes. |
GoogleBaseAttributeType |
getAttributeType()
Gets the type of the attribute this histogram describes. |
XmlParser.ElementHandler |
getHandler(ExtensionProfile extProfile,
java.lang.String namespace,
java.lang.String localName,
org.xml.sax.Attributes attrs)
Creates a handler for this gdata extension tag. |
int |
getTotalValueCount()
Gets the total number of values found for this attribute in the result set for the query. |
java.util.List<? extends AttributeHistogram.UniqueValue> |
getValues()
Gets a list of unique values for the attribute and the count for these values. |
java.util.List<? extends AttributeHistogram.UniqueValue> |
getValues(int minimumCount)
Gets a list of unique values for the attribute and the count of these values, for values repeated at least a certain number of times. |
void |
setAttributeId(GoogleBaseAttributeId attributeId)
Sets attribute name and type. |
void |
setAttributeId(java.lang.String name,
GoogleBaseAttributeType type)
Sets attribute name and type. |
void |
setTotalValueCount(int count)
Sets the total value count. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AttributeHistogram()
public AttributeHistogram(java.lang.String attributeName, GoogleBaseAttributeType attributeType)
attributeName
- attribute nameattributeType
- attribute typepublic AttributeHistogram(GoogleBaseAttributeId attributeId)
attributeId
- attribute IdMethod Detail |
---|
public java.lang.String getAttributeName()
public GoogleBaseAttributeType getAttributeType()
public GoogleBaseAttributeId getAttributeId()
public int getTotalValueCount()
>= sum(getValues().getCount())
public java.util.List<? extends AttributeHistogram.UniqueValue> getValues()
public java.util.List<? extends AttributeHistogram.UniqueValue> getValues(int minimumCount)
minimumCount
- minimum number of times the value should
have been encountered in the result set to matter
public void addValue(int count, java.lang.String stringRepresentation)
count
- number of time the value was foundstringRepresentation
-
java.lang.IllegalArgumentException
- unless count is greater than 0
java.lang.NullPointerException
- if stringRepresentation is nullpublic void setTotalValueCount(int count)
public void setAttributeId(java.lang.String name, GoogleBaseAttributeType type)
public void setAttributeId(GoogleBaseAttributeId attributeId)
public void generate(XmlWriter w, ExtensionProfile extProfile) throws java.io.IOException
generate
in interface Extension
w
- XML writerextProfile
- extension profile
java.io.IOException
- thrown if there was an error writing to the XmlWriterpublic XmlParser.ElementHandler getHandler(ExtensionProfile extProfile, java.lang.String namespace, java.lang.String localName, org.xml.sax.Attributes attrs) throws ParseException, java.io.IOException
getHandler
in interface Extension
extProfile
- extension profilenamespace
- extension namespacelocalName
- tag name, without the namespace prefixattrs
- tag attributes
ParseException
- when an unexpected tag or badly-formatted
XML is detected
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |