com.ebay.carad.os.vitalsigns.util
Class ReportUtil

java.lang.Object
  extended by com.ebay.carad.os.vitalsigns.util.ReportUtil

public abstract class ReportUtil
extends java.lang.Object

Home for miscellaneous reporting and DB utilities and constants.

Version:
$Id$
Author:
Jeremy Kraybill, Jeremy Thomerson

Field Summary
private static java.text.NumberFormat NUMBER_FORMATTER
          Number formatter.
 
Constructor Summary
ReportUtil()
           
 
Method Summary
static java.lang.String getDeltasAsHtml(float[] delta, boolean moreIsBetter)
          Takes a list of float deltas and writes an HTML string of the form "NN/NN/NN/..NN" where NN is expressed as a +/- percentage value.
static float getFloatFrom(java.lang.Object data)
          Attempts to convert an object into a float.
static DataPoint shiftTime(DataPoint row, long ms)
          Taks a logtime / data row and returns a new map, with logtime shifted by the given amount of milliseconds.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NUMBER_FORMATTER

private static final java.text.NumberFormat NUMBER_FORMATTER
Number formatter.

Constructor Detail

ReportUtil

public ReportUtil()
Method Detail

getFloatFrom

public static float getFloatFrom(java.lang.Object data)
Attempts to convert an object into a float. If it is not convertible, it returns 0.0.

Parameters:
data - the object to convert
Returns:
the float it converts to, or 0 if not convertible

shiftTime

public static DataPoint shiftTime(DataPoint row,
                                  long ms)
Taks a logtime / data row and returns a new map, with logtime shifted by the given amount of milliseconds. Used for moving dataseries to the right.

Parameters:
row - the row to transpose
ms - the number of milliseconds to move to the right.
Returns:
a new Map

getDeltasAsHtml

public static java.lang.String getDeltasAsHtml(float[] delta,
                                               boolean moreIsBetter)
Takes a list of float deltas and writes an HTML string of the form "NN/NN/NN/..NN" where NN is expressed as a +/- percentage value.

Parameters:
delta - a list of float % deltas (where 1.0 is +100%, -1.0 is -100% etc)
moreIsBetter - if true, negative values are red and positive are green; otherwise vice versa.
Returns:
a formatted HTML string


Copyright © 2004-2009. All Rights Reserved.