edu.sdsc.inca.consumer
Class Util

java.lang.Object
  extended by edu.sdsc.inca.consumer.Util

public class Util
extends java.lang.Object

Created by IntelliJ IDEA.

Author:
Shava Smallen <ssmallen@sdsc.edu>

Field Summary
static int TOOLTIP_MAX_STRING_LENGTH
           
 
Constructor Summary
Util()
           
 
Method Summary
static java.lang.String formatStringAsTooltip(java.lang.String tooltipText)
          Format text for a tooltip (jfreechart doesn't like ' or long strings.
static long getElapsedTime(long startTime)
          Small convenience function for printing out timing information.
static long getTimeNow()
          Small convenience function to return the current time in milliseconds.
static void printElapsedTime(long startTime, java.lang.String id)
          Small convenience function for printing out timing information.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TOOLTIP_MAX_STRING_LENGTH

public static final int TOOLTIP_MAX_STRING_LENGTH
See Also:
Constant Field Values
Constructor Detail

Util

public Util()
Method Detail

formatStringAsTooltip

public static java.lang.String formatStringAsTooltip(java.lang.String tooltipText)
Format text for a tooltip (jfreechart doesn't like ' or long strings. We also take out \n to make it easier to see.

Parameters:
tooltipText - A string to use for a tooltip text.
Returns:
A formatted tooltip string that can be used with jfreechart.

getElapsedTime

public static long getElapsedTime(long startTime)
Small convenience function for printing out timing information.

Parameters:
startTime - The time at which to compute the elapsed time from now.
Returns:
the elapsed time

getTimeNow

public static long getTimeNow()
Small convenience function to return the current time in milliseconds.

Returns:
the current time in milliseconds

printElapsedTime

public static void printElapsedTime(long startTime,
                                    java.lang.String id)
Small convenience function for printing out timing information.

Parameters:
startTime - The time at which to compute the elapsed time from now.
id - A small identifier string that can be used in the debug statement.