org.scubatoolkit.utils
Class ScubaUtils
java.lang.Object
|
+--org.scubatoolkit.utils.ScubaUtils
- public class ScubaUtils
- extends java.lang.Object
This class provides some general utility functions for use
* throughout the application. These include - internationalisation....
*
* @author Lee Turner
* @author Javier Vilalta
* @version 1.0
Field Summary |
private static java.lang.String |
resourceBundlePath
Path to where the resource bunles. |
private static java.util.ResourceBundle |
scubaResources
Holds the resourcebundle for the application. |
Method Summary |
static java.lang.String |
dateToTimeStamp(java.util.Date date)
|
static int |
getItemIndex(double[] list,
double item,
boolean roundDown)
|
static java.lang.String |
getProperty(java.lang.String propertyName)
Gets the specified property from the scuba toolkit resource
* bundle. |
static boolean |
isDouble(java.lang.String string)
|
static boolean |
isInteger(java.lang.String string)
|
static java.util.Date |
timeStampToDate(java.lang.String timeStamp)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
resourceBundlePath
private static java.lang.String resourceBundlePath
- Path to where the resource bunles.
scubaResources
private static java.util.ResourceBundle scubaResources
- Holds the resourcebundle for the application.
ScubaUtils
public ScubaUtils()
getProperty
public static java.lang.String getProperty(java.lang.String propertyName)
- Gets the specified property from the scuba toolkit resource
* bundle. Currently uses the default Locale to determine which
* resource bundle to use. This could be easily changed to allow
* the user to specify which language they want to use via the
* use of some preferences mechanism.
*
* @param propertyName The 'key' of the property who's value you want.
* @return The property value
isDouble
public static boolean isDouble(java.lang.String string)
isInteger
public static boolean isInteger(java.lang.String string)
getItemIndex
public static int getItemIndex(double[] list,
double item,
boolean roundDown)
- Parameters:
list
- - an array of double sorted in ascending order
* @param item - the double to look for in the list
* @param roundDown - boolean indicating whether the search should round down.
* @return returns an integer indicating the position of the item in the list.
dateToTimeStamp
public static java.lang.String dateToTimeStamp(java.util.Date date)
timeStampToDate
public static java.util.Date timeStampToDate(java.lang.String timeStamp)
throws java.text.ParseException
java.text.ParseException
Copyright © 2002 The Scuba Toolkit Team. All Rights Reserved.