|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcdx.scorebot.util.translator.TypeTranslator<T,java.lang.String>
cdx.scorebot.util.translator.TranslatorInstanceString<T>
public class TranslatorInstanceString<T>
Can translate to an Object of type T from a string. The Object is generated from the string by using the constructor in Object which has a single string as a parameter. The string is generated from the Object using the toString method.
| Constructor Summary | |
|---|---|
TranslatorInstanceString()
Instantiates a translator for an Object |
|
TranslatorInstanceString(java.lang.Class c)
Instantiates a translator |
|
TranslatorInstanceString(T o)
Instantiates a translator |
|
| Method Summary | |
|---|---|
java.lang.String |
translate1(T valueToTranslate)
gets the String representation of the specified object T |
T |
translate2(java.lang.String valueToTranslate)
gets the T 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 |
|---|
public TranslatorInstanceString()
public TranslatorInstanceString(T o)
o - an instance of the object to translate (only used to get the class)public TranslatorInstanceString(java.lang.Class c)
c - the class this translator translates from| Method Detail |
|---|
public java.lang.String translate1(T valueToTranslate)
translate1 in class TypeTranslator<T,java.lang.String>valueToTranslate - some object T
public T translate2(java.lang.String valueToTranslate)
throws TranslationFailedException
translate2 in class TypeTranslator<T,java.lang.String>valueToTranslate - some String
TranslationFailedException - thrown if the value cannot be translated
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||