|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cdx.scorebot.util.translator.TypeTranslator<FROM,TO> cdx.scorebot.util.translator.TranslatorMulti<FROM,TO>
public class TranslatorMulti<FROM,TO>
Can translate between two objects using different translaters depending on what type the two objects actually are. The user specifies which translators to use.
Constructor Summary | |
---|---|
TranslatorMulti()
Instantiates a translator for an Object |
Method Summary | |
---|---|
void |
addTranslator(java.lang.Class from,
java.lang.Class to,
TypeTranslator t)
adds a translator to use |
TO |
translate1(FROM valueToTranslate)
gets the TO representation of the specified object FROM |
FROM |
translate2(TO valueToTranslate)
gets the FROM representation of the specified TO object |
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 TranslatorMulti()
Method Detail |
---|
public void addTranslator(java.lang.Class from, java.lang.Class to, TypeTranslator t)
public TO translate1(FROM valueToTranslate) throws TranslationFailedException
translate1
in class TypeTranslator<FROM,TO>
valueToTranslate
- some object of type FROM
TranslationFailedException
- thrown if the value cannot be translatedpublic FROM translate2(TO valueToTranslate) throws TranslationFailedException
translate2
in class TypeTranslator<FROM,TO>
valueToTranslate
- some object of type TO
TranslationFailedException
- thrown if the value cannot be translated
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |