public class Metric extends ExtensionPoint
Modifier and Type | Class and Description |
---|---|
static class |
Metric.Type
The format of data represented by the metric.
|
ExtensionPoint.CumulativeBlobHandler, ExtensionPoint.ExtensionHandler
AbstractExtension.AttributesHandler
xmlBlob
localName, namespace
Constructor and Description |
---|
Metric()
Default mutable constructor.
|
Metric(java.lang.Double confidenceInterval,
java.lang.String name,
java.lang.String type,
java.lang.String value)
Immutable constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
consumeAttributes(AttributeHelper helper)
Consumes attributes from the attribute helper.
|
double |
doubleValue()
Gets the double value of this metric.
|
boolean |
equals(java.lang.Object obj) |
java.lang.Double |
getConfidenceInterval()
Returns the 95% confidence interval for this metric (lower is better).
|
static ExtensionDescription |
getDefaultDescription(boolean required,
boolean repeatable)
Returns the extension description, specifying whether it is required, and
whether it is repeatable.
|
java.lang.String |
getName()
Returns the name.
|
java.lang.String |
getType()
Returns the the format of data represented by the metric.
|
java.lang.String |
getValue()
Returns the value.
|
boolean |
hasConfidenceInterval()
Returns whether it has the 95% confidence interval for this metric (lower
is better).
|
int |
hashCode() |
boolean |
hasName()
Returns whether it has the name.
|
boolean |
hasType()
Returns whether it has the the format of data represented by the metric.
|
boolean |
hasValue()
Returns whether it has the value.
|
long |
longValue()
Gets the long value of this metric.
|
java.lang.Number |
numericValue()
Gets a numeric representation of this metric's value.
|
protected void |
putAttributes(AttributeGenerator generator)
Puts attributes into the attribute generator.
|
void |
setConfidenceInterval(java.lang.Double confidenceInterval)
Sets the 95% confidence interval for this metric (lower is better).
|
void |
setName(java.lang.String name)
Sets the name.
|
void |
setType(java.lang.String type)
Sets the the format of data represented by the metric.
|
void |
setValue(java.lang.String value)
Sets the value.
|
java.lang.String |
toString() |
protected void |
validate()
Checks the attributes to see if there are any problems.
|
addExtension, addExtension, addRepeatingExtension, addRepeatingExtension, checkRequiredExtensions, createExtensionInstance, declareExtensions, generate, generateCumulativeXmlBlob, generateExtensions, generateStartElement, getExtension, getExtensionDescription, getExtensionHandler, getExtensions, getHandler, getManifest, getRepeatingExtension, getRepeatingExtensions, getXmlBlob, hasExtension, hasRepeatingExtension, initializeArbitraryXml, parseCumulativeXmlBlob, removeExtension, removeExtension, removeRepeatingExtension, setExtension, setXmlBlob, visit, visitChild, visitChildren
disableStrictValidation, enableStrictValidation, eq, generate, generateAttributes, getExtensionLocalName, getExtensionNamespace, isImmutable, isStrictValidation, sameClassAs, setImmutable, throwExceptionForMissingAttribute, throwExceptionIfImmutable
public Metric()
public Metric(java.lang.Double confidenceInterval, java.lang.String name, java.lang.String type, java.lang.String value)
confidenceInterval
- 95% confidence interval for this metric (lower is
better).name
- name.type
- the format of data represented by the metric.value
- value.public java.lang.Double getConfidenceInterval()
public void setConfidenceInterval(java.lang.Double confidenceInterval)
confidenceInterval
- 95% confidence interval for this metric (lower is
better) or null
to resetpublic boolean hasConfidenceInterval()
public java.lang.String getName()
public void setName(java.lang.String name)
name
- name or null
to resetpublic boolean hasName()
public java.lang.String getType()
public void setType(java.lang.String type)
type
- the format of data represented by the metric or
null
to resetpublic boolean hasType()
public java.lang.String getValue()
public void setValue(java.lang.String value)
value
- value or null
to resetpublic boolean hasValue()
protected void validate()
AbstractExtension
validate
in class AbstractExtension
public static ExtensionDescription getDefaultDescription(boolean required, boolean repeatable)
required
- whether it is requiredrepeatable
- whether it is repeatableprotected void putAttributes(AttributeGenerator generator)
AbstractExtension
AbstractExtension.generate(XmlWriter,ExtensionProfile)
. Default implementation
does nothing, though generally this is discouraged unless there really are
no attributes.putAttributes
in class AbstractExtension
generator
- attribute generatorprotected void consumeAttributes(AttributeHelper helper) throws ParseException
AbstractExtension
AttributeHelper.consumeContent(boolean)
to consume the element's text
content. Called from AbstractExtension.getHandler(com.google.gdata.data.ExtensionProfile, java.lang.String, java.lang.String, org.xml.sax.Attributes)
. Default implementation does
nothing, though generally this is discouraged unless there really are no
attributes.consumeAttributes
in class AbstractExtension
helper
- attribute helperParseException
- any parsing exceptionpublic boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.Number numericValue()
"integer"
then the value returned by this method
is an instance of java.lang.Integer; otherwise it is an instance of
java.lang.Double.java.lang.NumberFormatException
- If the value of this metric cannot be parsed
into the the most appropriate numeric format for its typepublic long longValue()
public double doubleValue()