oms3
Class Conversions
java.lang.Object
oms3.Conversions
public class Conversions
- extends java.lang.Object
Conversion Utilities. This class deals with conversion from string values
to some known types.
- Author:
- Olaf David
Field Summary |
static boolean |
debug
|
Method Summary |
static
|
convert(java.lang.Object from,
java.lang.Class<? extends T> to)
|
static
|
convert(java.lang.Object from,
java.lang.Class<? extends T> to,
java.lang.Object... arg)
Convert a String value into an object of a certain type |
static java.lang.String |
formatISO(java.util.Date date)
|
static java.text.SimpleDateFormat |
ISO()
|
static void |
main(java.lang.String[] args)
|
static java.lang.String[] |
parseArrayElement(java.lang.String src)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
debug
public static boolean debug
Conversions
public Conversions()
convert
public static <T> T convert(java.lang.Object from,
java.lang.Class<? extends T> to,
java.lang.Object... arg)
- Convert a String value into an object of a certain type
- Parameters:
to
- the type to convert tofrom
- the value to convertarg
- conversion argument (e.g. Dateformat)
- Returns:
- the object of a certain type.
convert
public static <T> T convert(java.lang.Object from,
java.lang.Class<? extends T> to)
parseArrayElement
public static java.lang.String[] parseArrayElement(java.lang.String src)
- Parameters:
src
- e.g test[1][3]
- Returns:
- [test,1,2]
formatISO
public static java.lang.String formatISO(java.util.Date date)
ISO
public static java.text.SimpleDateFormat ISO()
main
public static void main(java.lang.String[] args)
throws java.text.ParseException
- Throws:
java.text.ParseException
Generated 2010-08-11 08:44:20 MDT, USDA-ARS-ASRU/CSU, 2150 Center Ave, Fort Collins, CO 80526, U.S.A.