Overview | Package | Class | Tree | Deprecated | Index | Help
| Hyperic HQ Plugin API v. 4.4.0.2
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.hyperic.hq.product
Class MetricValue

    java.lang.Object
      org.hyperic.hq.product.MetricValue

All Implemented Interfaces:
  java.io.Serializable, java.lang.Comparable, IComparableDatapoint, IDataPoint, IDisplayDataPoint

Direct Known Subclasses:
  AvailabilityMetricValue, DownMetricValue, HighLowMetricValue

    public class MetricValue

extends java.lang.Object
implements IDisplayDataPoint, IComparableDatapoint, java.io.Serializable

Represents a value of a Metric.

See Also:
  `MeasurementPluginManager.getValue(java.lang.String)`, `XXX: It would be best if this object were immutable. -- JMT 11/31/09`, Serialized Form

Field Summary
`static MetricValue` | `FUTURE` Metric template is valid, but no value is available.
`static MetricValue` | `NONE` Metric template is valid, but no value is available.
`static double` | `VALUE_FUTURE`
`static double` | `VALUE_NONE`

Constructor Summary
`MetricValue()`
`MetricValue(double value)` Default retrieval time to System.currentTimeMillis()
`MetricValue(double value, long rtime)`
`MetricValue(long value)` Default retrieval time to System.currentTimeMillis()
`MetricValue(long value, long rtime)`
`MetricValue(MetricValue src)`
`MetricValue(MetricValue objectValue, long rtime)`
`MetricValue(java.lang.Number objectValue)` Default retrieval time to System.currentTimeMillis()
`MetricValue(java.lang.Number objectValue, long rtime)`

Method Summary
`int` | `compareTo(java.lang.Object o)` This is for the Datapoint interface.
`boolean` | `equals(java.lang.Object obj)`
`java.lang.String` | `getLabel()` Retrieves the label of a chart data point.
`java.lang.Double` | `getObjectValue()`
`long` | `getTimestamp()`
`double` | `getValue()` Retrieves the value of a chart data point.
`boolean` | `isFuture()`
`boolean` | `isNone()`
`void` | `setTimestamp(long t)`
`void` | `setValue(double value)`
`java.lang.String` | `toString()`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### VALUE_NONE

    public static final double VALUE_NONE

See Also:
  Constant Field Values

### NONE

    public static final MetricValue NONE

  Metric template is valid, but no value is available. Plugins may return this value, for example, where certain metrics are only available depending on resource configuration, version, etc. NONE.getValue() is the VALUE_NONE constant. This value will not be sent back to the server.

### VALUE_FUTURE

    public static final double VALUE_FUTURE

See Also:
  Constant Field Values

### FUTURE

    public static final MetricValue FUTURE

  Metric template is valid, but no value is available. The value is being collected in the background and is expected to be available in the near future. The agent may re-try collection of measurements returning this value sooner than the configured collection interval. FUTURE.getValue() is the VALUE_FUTURE constant. This value will not be sent back to the server.

Constructor Detail

### MetricValue

    public MetricValue()

### MetricValue

    public MetricValue(double value,
                       long rtime)

### MetricValue

    public MetricValue(MetricValue src)

### MetricValue

    public MetricValue(double value)

  Default retrieval time to System.currentTimeMillis()

### MetricValue

    public MetricValue(java.lang.Number objectValue,
                       long rtime)

### MetricValue

    public MetricValue(java.lang.Number objectValue)

  Default retrieval time to System.currentTimeMillis()

### MetricValue

    public MetricValue(MetricValue objectValue,
                       long rtime)

### MetricValue

    public MetricValue(long value,
                       long rtime)

### MetricValue

    public MetricValue(long value)

  Default retrieval time to System.currentTimeMillis()

Method Detail

### isNone

    public boolean isNone()

  Returns:
    true if getValue() == VALUE_NONE, false otherwise.

### isFuture

    public boolean isFuture()

  Returns:
    true if getValue() == VALUE_FUTURE, false otherwise.

### toString

    public java.lang.String toString()

  Overrides:
    `toString` in class `java.lang.Object`
  Returns:
    "None" if isNone(), "Future" if isFuture(), else NumberFormat.format(getValue())

### getObjectValue

    public java.lang.Double getObjectValue()

### getValue

    public double getValue()

  Description copied from interface: `IDataPoint`
  Retrieves the value of a chart data point. The label is displayed on the Y axis for line and column charts.

  Specified by:
    `getValue` in interface `IDataPoint`
  Returns:
    A floating point value for a chart data point.

### setValue

    public void setValue(double value)

### getTimestamp

    public long getTimestamp()

  Specified by:
    `getTimestamp` in interface `IDisplayDataPoint`
  Returns:
    The absolute time of the datum, in milliseconds.

### setTimestamp

    public void setTimestamp(long t)

### getLabel

    public java.lang.String getLabel()

  Description copied from interface: `IDisplayDataPoint`
  Retrieves the label of a chart data point. The data point is charted on the X axis for line and column charts.

  Specified by:
    `getLabel` in interface `IDisplayDataPoint`
  Returns:
    A String label for a chart data point.

### compareTo

    public int compareTo(java.lang.Object o)

  This is for the Datapoint interface. It compares only the value of the measurements, not the timestamp.

  Specified by:
    `compareTo` in interface `java.lang.Comparable`

### equals

    public boolean equals(java.lang.Object obj)

  Overrides:
    `equals` in class `java.lang.Object`

Overview | Package | Class | Tree | Deprecated | Index | Help
| Hyperic HQ Plugin API v. 4.4.0.2
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004-2006 Hyperic, Inc. support@hyperic.net, All Rights Reserved.