public class

Metric

extends ExtensionPoint
java.lang.Object
   ↳ com.google.gdata.data.AbstractExtension
     ↳ com.google.gdata.data.ExtensionPoint
       ↳ com.google.gdata.data.analytics.Metric

Class Overview

Metric value.

Summary

Nested Classes
class Metric.Type The format of data represented by the metric. 
Constants
String CONFIDENCEINTERVAL XML "confidenceInterval" attribute name
String NAME XML "name" attribute name
String TYPE XML "type" attribute name
String VALUE XML "value" attribute name
String XML_NAME XML element name
Fields
private Double confidenceInterval 95% confidence interval for this metric (lower is better)
private String name Name
private String type The format of data represented by the metric
private String value Value
[Expand]
Inherited Fields
From class com.google.gdata.data.ExtensionPoint
From class com.google.gdata.data.AbstractExtension
Public Constructors
Metric()
Default mutable constructor.
Metric(Double confidenceInterval, String name, String type, String value)
Immutable constructor.
Public Methods
double doubleValue()
Gets the double value of this metric.
boolean equals(Object obj)
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.
String getName()
Returns the name.
String getType()
Returns the the format of data represented by the metric.
String getValue()
Returns the value.
boolean hasConfidenceInterval()
Returns whether it has the 95% confidence interval for this metric (lower is better).
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.
int hashCode()
long longValue()
Gets the long value of this metric.
Number numericValue()
Gets a numeric representation of this metric's value.
void setConfidenceInterval(Double confidenceInterval)
Sets the 95% confidence interval for this metric (lower is better).
void setName(String name)
Sets the name.
void setType(String type)
Sets the the format of data represented by the metric.
void setValue(String value)
Sets the value.
String toString()
Protected Methods
void consumeAttributes(AttributeHelper helper)
Consumes attributes from the attribute helper.
void putAttributes(AttributeGenerator generator)
Puts attributes into the attribute generator.
void validate()
Checks the attributes to see if there are any problems.
[Expand]
Inherited Methods
From class com.google.gdata.data.ExtensionPoint
From class com.google.gdata.data.AbstractExtension
From class java.lang.Object
From interface com.google.gdata.data.Extension

Constants

private static final String CONFIDENCEINTERVAL

XML "confidenceInterval" attribute name

Constant Value: "confidenceInterval"

private static final String NAME

XML "name" attribute name

Constant Value: "name"

private static final String TYPE

XML "type" attribute name

Constant Value: "type"

private static final String VALUE

XML "value" attribute name

Constant Value: "value"

static final String XML_NAME

XML element name

Constant Value: "metric"

Fields

private Double confidenceInterval

95% confidence interval for this metric (lower is better)

private String name

Name

private String type

The format of data represented by the metric

private String value

Value

Public Constructors

public Metric ()

Default mutable constructor.

public Metric (Double confidenceInterval, String name, String type, String value)

Immutable constructor.

Parameters
confidenceInterval 95% confidence interval for this metric (lower is better).
name Name.
type The format of data represented by the metric.
value Value.

Public Methods

public double doubleValue ()

Gets the double value of this metric. If the underlying data is an integer value, then the number returned by this method is the result of casting that integer to type double.

public boolean equals (Object obj)

Parameters
obj

public Double getConfidenceInterval ()

Returns the 95% confidence interval for this metric (lower is better).

Returns
  • 95% confidence interval for this metric (lower is better)

public static ExtensionDescription getDefaultDescription (boolean required, boolean repeatable)

Returns the extension description, specifying whether it is required, and whether it is repeatable.

Parameters
required Whether it is required
repeatable Whether it is repeatable
Returns
  • extension description

public String getName ()

Returns the name.

Returns
  • name

public String getType ()

Returns the the format of data represented by the metric.

Returns
  • the format of data represented by the metric

public String getValue ()

Returns the value.

Returns
  • value

public boolean hasConfidenceInterval ()

Returns whether it has the 95% confidence interval for this metric (lower is better).

Returns
  • whether it has the 95% confidence interval for this metric (lower is better)

public boolean hasName ()

Returns whether it has the name.

Returns
  • whether it has the name

public boolean hasType ()

Returns whether it has the the format of data represented by the metric.

Returns
  • whether it has the the format of data represented by the metric

public boolean hasValue ()

Returns whether it has the value.

Returns
  • whether it has the value

public int hashCode ()

public long longValue ()

Gets the long value of this metric. If the underlying data is a floating-point number, then the number returned by this method is the result of casting that floating-point number to type long.

public Number numericValue ()

Gets a numeric representation of this metric's value. The exact subclass of Number returned can be determined by the result of getType(): if getType() returns "integer" then the value returned by this method is an instance of java.lang.Integer; otherwise it is an instance of java.lang.Double.

Returns
  • A numeric representation of the value of this metric
Throws
NumberFormatException If the value of this metric cannot be parsed into the the most appropriate numeric format for its type

public void setConfidenceInterval (Double confidenceInterval)

Sets the 95% confidence interval for this metric (lower is better).

Parameters
confidenceInterval 95% confidence interval for this metric (lower is better) or null to reset

public void setName (String name)

Sets the name.

Parameters
name Name or null to reset

public void setType (String type)

Sets the the format of data represented by the metric.

Parameters
type The format of data represented by the metric or null to reset

public void setValue (String value)

Sets the value.

Parameters
value Value or null to reset

public String toString ()

Protected Methods

protected void consumeAttributes (AttributeHelper helper)

Consumes attributes from the attribute helper. May also use consumeContent(boolean) to consume the element's text content. Called from getHandler(ExtensionProfile, String, String, Attributes). Default implementation does nothing, though generally this is discouraged unless there really are no attributes.

Parameters
helper Attribute helper

protected void putAttributes (AttributeGenerator generator)

Puts attributes into the attribute generator. Called from generate(XmlWriter, ExtensionProfile). Default implementation does nothing, though generally this is discouraged unless there really are no attributes.

Parameters
generator Attribute generator

protected void validate ()

Checks the attributes to see if there are any problems. Default implementation does nothing, though generally this is discouraged unless there really are no restrictions.