public class AttributeHistogram extends Object implements Extension
GoogleBaseEntry.getGoogleBaseMetadata().getAttributeHistogram().| Modifier and Type | Class and Description |
|---|---|
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 and Description |
|---|
AttributeHistogram()
Creates an unitialized AttributeHistogram.
|
AttributeHistogram(GoogleBaseAttributeId attributeId)
Creates and initializes an AttributeHistogram.
|
AttributeHistogram(String attributeName,
GoogleBaseAttributeType attributeType)
Creates and initializes an AttributeHistogram.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addValue(int count,
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.
|
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,
String namespace,
String localName,
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.
|
List<? extends AttributeHistogram.UniqueValue> |
getValues()
Gets a list of unique values for the attribute and
the count for these values.
|
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(String name,
GoogleBaseAttributeType type)
Sets attribute name and type.
|
void |
setTotalValueCount(int count)
Sets the total value count.
|
public AttributeHistogram()
public AttributeHistogram(String attributeName, GoogleBaseAttributeType attributeType)
attributeName - attribute nameattributeType - attribute typepublic AttributeHistogram(GoogleBaseAttributeId attributeId)
attributeId - attribute Idpublic String getAttributeName()
public GoogleBaseAttributeType getAttributeType()
public GoogleBaseAttributeId getAttributeId()
public int getTotalValueCount()
>= sum(getValues().getCount())public List<? extends AttributeHistogram.UniqueValue> getValues()
public List<? extends AttributeHistogram.UniqueValue> getValues(int minimumCount)
minimumCount - minimum number of times the value should
have been encountered in the result set to matterpublic void addValue(int count,
String stringRepresentation)
count - number of time the value was foundstringRepresentation - IllegalArgumentException - unless count is greater than 0NullPointerException - if stringRepresentation is nullpublic void setTotalValueCount(int count)
public void setAttributeId(String name, GoogleBaseAttributeType type)
public void setAttributeId(GoogleBaseAttributeId attributeId)
public void generate(XmlWriter w, ExtensionProfile extProfile) throws IOException
generate in interface Extensionw - XML writerextProfile - extension profileIOException - thrown if there was an error writing to the XmlWriterpublic XmlParser.ElementHandler getHandler(ExtensionProfile extProfile, String namespace, String localName, Attributes attrs) throws ParseException, IOException
getHandler in interface ExtensionextProfile - extension profilenamespace - extension namespacelocalName - tag name, without the namespace prefixattrs - tag attributesParseException - when an unexpected tag or badly-formatted
XML is detectedIOExceptionCopyright © 2012. All Rights Reserved.