com.bigdata.jini.util
Class ConfigMath

java.lang.Object
  extended by com.bigdata.jini.util.ConfigMath

public class ConfigMath
extends Object

A utility class to help with Configurations.

Version:
$Id$
Author:
Bryan Thompson

Constructor Summary
ConfigMath()
           
 
Method Summary
static double add(double a, double b)
           
static int add(int a, int b)
           
static long add(long a, long b)
           
static File getAbsoluteFile(File file)
          Return the absolute file for the file.
static String getAbsolutePath(File file)
          Return the absolute path for the file.
static String getURIString(File file)
          Convert a file into an absolute URI and return its representation.
static long m2ms(long m)
          Convert minutes to milliseconds.
static long ms2ns(long ms)
          Convert milliseconds to nanoseconds.
static double multiply(double a, double b)
           
static int multiply(int a, int b)
           
static long multiply(long a, long b)
           
static String q(String v)
          Quote a string value.
static long s2ms(long s)
          Convert seconds to milliseconds.
static long s2ns(long s)
          Convert seconds to nanoseconds.
static String toString(Object o)
          Useful for enums which can't be handled otherwise.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfigMath

public ConfigMath()
Method Detail

add

public static int add(int a,
                      int b)

add

public static long add(long a,
                       long b)

add

public static double add(double a,
                         double b)

multiply

public static int multiply(int a,
                           int b)

multiply

public static long multiply(long a,
                            long b)

multiply

public static double multiply(double a,
                              double b)

toString

public static String toString(Object o)
Useful for enums which can't be handled otherwise.

Parameters:
o -
Returns:

s2ns

public static long s2ns(long s)
Convert seconds to nanoseconds.

Parameters:
s - seconds.
Returns:
Nanoseconds.

ms2ns

public static long ms2ns(long ms)
Convert milliseconds to nanoseconds.

Parameters:
ms - Milliseconds.
Returns:
Nanoseconds.

s2ms

public static long s2ms(long s)
Convert seconds to milliseconds.

Parameters:
s - seconds.
Returns:
Milliseconds.

m2ms

public static long m2ms(long m)
Convert minutes to milliseconds.

Parameters:
m - minutes.
Returns:
Milliseconds.

getAbsolutePath

public static String getAbsolutePath(File file)
Return the absolute path for the file.

Parameters:
file - The file.
Returns:
The absolute path for that file.

getAbsoluteFile

public static File getAbsoluteFile(File file)
Return the absolute file for the file.

Parameters:
file - The file.
Returns:
The absolute file for that file.

getURIString

public static String getURIString(File file)
Convert a file into an absolute URI and return its representation.

Parameters:
file - The file.
Returns:
The representation of the corresponding absolute URI.

q

public static String q(String v)
Quote a string value.

Parameters:
v - The value.
Returns:
The quoted value.
TODO:
Use ConfigUtil.stringLiteral(String) instead?


Copyright © 2006-2009 SYSTAP, LLC. All Rights Reserved.