dsto.dfc.swing.text
Class NumberConverter

java.lang.Object
  extended by dsto.dfc.swing.text.NumberConverter
All Implemented Interfaces:
ValueConverter

public class NumberConverter
extends Object
implements ValueConverter

A value converter that supports conversion of standard Java numeric types to/from String form.

Version:
$Revision$

Field Summary
static NumberConverter INSTANCE
           
 
Constructor Summary
NumberConverter()
           
 
Method Summary
 Object convertTo(Object value, Class form)
          Convert a value to a given class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final NumberConverter INSTANCE
Constructor Detail

NumberConverter

public NumberConverter()
Method Detail

convertTo

public Object convertTo(Object value,
                        Class form)
                 throws IllegalFormatException
Description copied from interface: ValueConverter
Convert a value to a given class.

Specified by:
convertTo in interface ValueConverter
Parameters:
value - The value to convert.
form - The new class.
Returns:
A new instance of form containing the converted value.
Throws:
IllegalFormatException - if conversion was not possible.


Copyright © 2008 Commonwealth of Australia