net.sourceforge.jgeocoder
Class CommonUtils
java.lang.Object
net.sourceforge.jgeocoder.CommonUtils
public class CommonUtils
- extends Object
Method Summary |
static double |
getElapsed(long startInMilli,
TimeUnit unit)
Calculate the elapsed time in specified TimeUnit |
static
|
nvl(T value,
T replacement)
Replace an object with a replacement object if it's null |
static void |
printElapsed(long startInMilli,
TimeUnit unit)
Convenient method for printing elapsed time |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CommonUtils
public CommonUtils()
nvl
public static <T> T nvl(T value,
T replacement)
- Replace an object with a replacement object if it's
null
- Type Parameters:
T
- - Parameters:
value
- the object to test for a null value.replacement
- the value returned if input value
is null.
- Returns:
replacement
if input value
is null,
value
otherwise.
getElapsed
public static double getElapsed(long startInMilli,
TimeUnit unit)
- Calculate the elapsed time in specified
TimeUnit
- Parameters:
startInMilli
- unit
-
- Returns:
printElapsed
public static void printElapsed(long startInMilli,
TimeUnit unit)
- Convenient method for printing elapsed time
- Parameters:
startInMilli
- unit
-
Copyright © 2008. All Rights Reserved.