org.apache.commons.math.util
Class DefaultTransformer
java.lang.Object
org.apache.commons.math.util.DefaultTransformer
- All Implemented Interfaces:
- java.io.Serializable, NumberTransformer
public class DefaultTransformer
- extends java.lang.Object
- implements NumberTransformer, java.io.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: 800112 $ $Date: 2009-08-02 13:23:37 -0400 (Sun, 02 Aug 2009) $
- See Also:
- Serialized Form
Field Summary |
private static long |
serialVersionUID
Serializable version identifier |
Method Summary |
boolean |
equals(java.lang.Object other)
|
int |
hashCode()
|
double |
transform(java.lang.Object o)
Implementing this interface provides a facility to transform
from Object to Double. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
serialVersionUID
private static final long serialVersionUID
- Serializable version identifier
- See Also:
- Constant Field Values
DefaultTransformer
public DefaultTransformer()
transform
public double transform(java.lang.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:
equals
public boolean equals(java.lang.Object other)
-
- Overrides:
equals
in class java.lang.Object
hashCode
public int hashCode()
-
- Overrides:
hashCode
in class java.lang.Object
Copyright (c) 2003-2010 Apache Software Foundation