cdx.scorebot.util.translator
Class TranslatorIntegerString

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

public class TranslatorIntegerString
extends TypeTranslator<java.lang.Integer,java.lang.String>

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

Author:
David Underhill
See Also:
Serialized Form

Constructor Summary
TranslatorIntegerString()
          Instantiates a translator
 
Method Summary
 java.lang.String translate1(java.lang.Integer valueToTranslate)
          gets the String representation of the specified Integer
 java.lang.Integer translate2(java.lang.String valueToTranslate)
          gets the Integer 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

TranslatorIntegerString

public TranslatorIntegerString()
Instantiates a translator

Method Detail

translate1

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

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

translate2

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

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