gov.sandia.cognition.data.convert.number
Class StringToDoubleConverter

java.lang.Object
  extended by gov.sandia.cognition.util.AbstractCloneableSerializable
      extended by gov.sandia.cognition.data.convert.AbstractDataConverter<InputType,OutputType>
          extended by gov.sandia.cognition.data.convert.AbstractReversibleDataConverter<InputType,OutputType>
              extended by gov.sandia.cognition.data.convert.AbstractReverseCachedDataConverter<String,Double,ObjectToStringConverter>
                  extended by gov.sandia.cognition.data.convert.number.StringToDoubleConverter
All Implemented Interfaces:
DataConverter<String,Double>, ReversibleDataConverter<String,Double>, Evaluator<String,Double>, ReversibleEvaluator<String,Double,DataConverter<? super Double,? extends String>>, CloneableSerializable, Serializable, Cloneable

public class StringToDoubleConverter
extends AbstractReverseCachedDataConverter<String,Double,ObjectToStringConverter>

Converts a String to a Double using the Double.valueOf method.

Since:
3.0
Author:
Justin Basilico
See Also:
Serialized Form

Field Summary
 
Fields inherited from class gov.sandia.cognition.data.convert.AbstractReverseCachedDataConverter
reverse
 
Constructor Summary
StringToDoubleConverter()
          Creates a new StringToDoubleConverter.
 
Method Summary
protected  ObjectToStringConverter createReverse()
          Creates a new reverse converter.
 Double evaluate(String input)
          Converts the given String to a Double.
 
Methods inherited from class gov.sandia.cognition.data.convert.AbstractReverseCachedDataConverter
reverse
 
Methods inherited from class gov.sandia.cognition.util.AbstractCloneableSerializable
clone
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringToDoubleConverter

public StringToDoubleConverter()
Creates a new StringToDoubleConverter.

Method Detail

evaluate

public Double evaluate(String input)
Converts the given String to a Double.

Parameters:
input - The String to convert.
Returns:
The double value of the String.

createReverse

protected ObjectToStringConverter createReverse()
Description copied from class: AbstractReverseCachedDataConverter
Creates a new reverse converter. Should only be called when there is a cache miss for this converter.

Specified by:
createReverse in class AbstractReverseCachedDataConverter<String,Double,ObjectToStringConverter>
Returns:
The reverse converter.