Class NumberTypeWrapper
- java.lang.Object
-
- net.sourceforge.jeuclid.context.typewrapper.AbstractSimpleTypeWrapper
-
- net.sourceforge.jeuclid.context.typewrapper.NumberTypeWrapper
-
- All Implemented Interfaces:
java.io.Serializable,TypeWrapper
public final class NumberTypeWrapper extends AbstractSimpleTypeWrapper
Converting String to Numbers and vice versa is also straightforward.- Version:
- $Revision: 03dc0884e86f $
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface net.sourceforge.jeuclid.context.typewrapper.TypeWrapper
FAILED_TO_CONVERT, TO
-
-
Constructor Summary
Constructors Constructor Description NumberTypeWrapper(java.lang.Class<? extends java.lang.Number> valueType)Simple constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ObjectfromString(java.lang.String value)Attempts to convert a parameter value expressed as string into an instance of the appropriate (for this parameter) type.static TypeWrappergetInstance(java.lang.Class<? extends java.lang.Number> valueType)-
Methods inherited from class net.sourceforge.jeuclid.context.typewrapper.AbstractSimpleTypeWrapper
getValueType, toString, valid
-
-
-
-
Method Detail
-
getInstance
public static TypeWrapper getInstance(java.lang.Class<? extends java.lang.Number> valueType)
- Parameters:
valueType- a subclass of Number- Returns:
- the singleton instance.
-
fromString
public java.lang.Object fromString(java.lang.String value)
Attempts to convert a parameter value expressed as string into an instance of the appropriate (for this parameter) type.- Specified by:
fromStringin interfaceTypeWrapper- Overrides:
fromStringin classAbstractSimpleTypeWrapper- Parameters:
value- parameter value as string- Returns:
- parameter value as an instance of the proper type
-
-