cat.hist
Class Util

java.lang.Object
  extended bycat.hist.Util

public class Util
extends java.lang.Object

This class is used by the database server, which may be local or remote. This class provides some methods for finding particular information from the database.


Constructor Summary
Util()
           
 
Method Summary
static java.lang.String findClosest(java.util.Vector values, java.util.Vector times, java.lang.String time)
          Finds the closest value that is just less than given time.
static java.lang.String formatTime(java.util.Calendar calendar)
          Formats a calendar time object into SQL string form.
static double getAverage(double[] ds)
          Returns average of all the doubles.
static double getAverage(java.util.Vector v)
          Returns average of all the doubles.
static java.lang.String[] parseProperty(java.lang.String s)
          parses SQL string into array of strings.
static double[] vector2Doubles(java.util.Vector v)
          Turns vector of doubles into array of doubles.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Util

public Util()
Method Detail

getAverage

public static double getAverage(double[] ds)
Returns average of all the doubles.


getAverage

public static double getAverage(java.util.Vector v)
Returns average of all the doubles.


vector2Doubles

public static double[] vector2Doubles(java.util.Vector v)
Turns vector of doubles into array of doubles.


parseProperty

public static java.lang.String[] parseProperty(java.lang.String s)
parses SQL string into array of strings.


findClosest

public static java.lang.String findClosest(java.util.Vector values,
                                           java.util.Vector times,
                                           java.lang.String time)
Finds the closest value that is just less than given time.

Parameters:
values - The values to look through
times - The times for the given values
time - The time to look for.

formatTime

public static java.lang.String formatTime(java.util.Calendar calendar)
Formats a calendar time object into SQL string form.