cdx.scorebot.util.translator
Class TranslatorDoubleString

java.lang.Object
  extended by cdx.scorebot.util.translator.TypeTranslator<java.lang.Double,java.lang.String>
      extended by cdx.scorebot.util.translator.TranslatorDoubleString
All Implemented Interfaces:
java.io.Serializable

public class TranslatorDoubleString
extends TypeTranslator<java.lang.Double,java.lang.String>

Stores a value as a String and can translate to and from an Double.

Author:
David Underhill
See Also:
Serialized Form

Constructor Summary
TranslatorDoubleString()
          Instantiates a translator
 
Method Summary
 java.lang.String translate1(java.lang.Double valueToTranslate)
          gets the String representation of the specified Double
 java.lang.Double translate2(java.lang.String valueToTranslate)
          gets the Double representation of the specified String
 
Methods inherited from class cdx.scorebot.util.translator.TypeTranslator
canTranslate1, canTranslate2, getLastException
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TranslatorDoubleString

public TranslatorDoubleString()
Instantiates a translator

Method Detail

translate1

public java.lang.String translate1(java.lang.Double valueToTranslate)
gets the String representation of the specified Double

Specified by:
translate1 in class TypeTranslator<java.lang.Double,java.lang.String>
Parameters:
valueToTranslate - some Double
Returns:
the String representation of the valueToTranslate (null if valueToTranslate is null)

translate2

public java.lang.Double translate2(java.lang.String valueToTranslate)
                            throws TranslationFailedException
gets the Double representation of the specified String

Specified by:
translate2 in class TypeTranslator<java.lang.Double,java.lang.String>
Parameters:
valueToTranslate - some String
Returns:
the Double representation of the valueToTranslate
Throws:
TranslationFailedException - thrown if the value cannot be translated