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.util.math
Class Average

    java.lang.Object
      org.hyperic.util.math.Average

    public class Average

extends java.lang.Object

Average implements general math functions for calculating averages.

Method Summary
`static java.lang.Double` | `average(java.lang.Object values)` Calculates the average of a values Array of java.lang.Number objects that contain a double value.
`static java.lang.Double` | `runningAverage(java.lang.Object average, java.lang.Object next, int count)`
`static java.lang.Double` | `runningAverage(java.lang.Object average, java.lang.Object next, int count, float weight)`
`static java.lang.Double` | `weightedAverage(java.lang.Object values, java.lang.Object weights)`

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

Method Detail

### average

    public static java.lang.Double average(java.lang.Object values)

  Calculates the average of a values Array of java.lang.Number objects that contain a double value.

  Parameters:
    `Object` - Array reference
  Returns:
    Double
  Throws:
    `None` - - by design.

### weightedAverage

    public static java.lang.Double weightedAverage(java.lang.Object values,
                                                   java.lang.Object weights)

  Parameters:
    `The` - values Object array reference.
    `The` - weights Object array reference.
  Returns:
    Double containing weigted average.

### runningAverage

    public static java.lang.Double runningAverage(java.lang.Object average,
                                                  java.lang.Object next,
                                                  int count)

  Parameters:
    `Current` - average - Number with double value.
    `Next` - value - Number with double value.
    `Current` - index counter

### runningAverage

    public static java.lang.Double runningAverage(java.lang.Object average,
                                                  java.lang.Object next,
                                                  int count,
                                                  float weight)

  Parameters:
    `Current` - average - Number with double value.
    `Next` - value - Number with double value.
    `Current` - index counter
    `Weights` - for weighted average

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.