org.hackystat.telemetry.analyzer.function.impl
Class AddFunction

java.lang.Object
  extended by org.hackystat.telemetry.analyzer.function.TelemetryFunction
      extended by org.hackystat.telemetry.analyzer.function.impl.AddFunction

public class AddFunction
extends TelemetryFunction

If passed two numbers, returns their sum, and if passed two telemetry streams, returns a new TelemetryStreamCollection containing the pairwise addition of the individual elements.

Author:
(Cedric) Qin ZHANG, Philip Johnson

Constructor Summary
AddFunction()
          Constructs this instance.
 
Method Summary
 java.lang.Object compute(java.lang.Object[] parameters)
          Invokes the function.
 
Methods inherited from class org.hackystat.telemetry.analyzer.function.TelemetryFunction
getName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AddFunction

public AddFunction()
Constructs this instance.

Method Detail

compute

public java.lang.Object compute(java.lang.Object[] parameters)
                         throws TelemetryFunctionException
Description copied from class: TelemetryFunction
Invokes the function. Note that multiple thread might call this method at the same time. The implementation must be thread-safe.

Specified by:
compute in class TelemetryFunction
Parameters:
parameters - An array of 2 objects of type either Number or TelemetryStreamCollection.
Returns:
Either an instance of Number or TelemetryStreamCollection.
Throws:
TelemetryFunctionException - If anything is wrong.