org.apache.commons.math.util
Class DefaultTransformer
java.lang.Object
org.apache.commons.math.util.DefaultTransformer
- All Implemented Interfaces:
- NumberTransformer, Serializable
- public class DefaultTransformer
- extends Object
- implements NumberTransformer, Serializable
A Default NumberTransformer for java.lang.Numbers and Numeric Strings. This
provides some simple conversion capabilities to turn any java/lang.Number
into a primitive double or to turn a String representation of a Number into
a double.
- Version:
- $Revision: 348519 $ $Date: 2005-11-23 12:12:18 -0700 (Wed, 23 Nov 2005) $
- See Also:
- Serialized Form
Method Summary |
double |
transform(Object o)
Implementing this interface provides a facility to transform
from Object to Double. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultTransformer
public DefaultTransformer()
transform
public double transform(Object o)
throws MathException
- Description copied from interface:
NumberTransformer
- Implementing this interface provides a facility to transform
from Object to Double.
- Specified by:
transform
in interface NumberTransformer
- Parameters:
o
- the object that gets transformed.
- Returns:
- a double primitive representation of the Object o.
- Throws:
MathException
- If it cannot successfully
be transformed or is null.- See Also:
Transformer
Copyright © 2003-2008 The Apache Software Foundation. All Rights Reserved.