|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcdx.scorebot.util.translator.TypeTranslator<TYPE1,TYPE2>
public abstract class TypeTranslator<TYPE1,TYPE2>
Declares translation methods a parameter must have so it can be translated between a one type and another type.
| Constructor Summary | |
|---|---|
TypeTranslator()
Instantiates a translator |
|
| Method Summary | |
|---|---|
boolean |
canTranslate1(TYPE1 valueToTranslate)
whether or not the specified value can be translated to TYPE2 |
boolean |
canTranslate2(TYPE2 valueToTranslate)
whether or not the specified value can be translated to TYPE1 |
TranslationFailedException |
getLastException()
gets the last exception thrown when the translation was attempted (null if none have been thown) |
abstract TYPE2 |
translate1(TYPE1 valueToTranslate)
gets the TYPE2 representation of the item |
abstract TYPE1 |
translate2(TYPE2 valueToTranslate)
gets the TYPE1 representation of the item |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TypeTranslator()
| Method Detail |
|---|
public boolean canTranslate1(TYPE1 valueToTranslate)
valueToTranslate - some value
public abstract TYPE2 translate1(TYPE1 valueToTranslate)
throws TranslationFailedException
valueToTranslate - some value
TranslationFailedException - thrown if the value cannot be translatedpublic boolean canTranslate2(TYPE2 valueToTranslate)
valueToTranslate - some value
public abstract TYPE1 translate2(TYPE2 valueToTranslate)
throws TranslationFailedException
valueToTranslate - some value
TranslationFailedException - thrown if the value cannot be translatedpublic TranslationFailedException getLastException()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||