com.penguinwerks.jodene.data
Class TranslatedField
java.lang.Object
com.penguinwerks.jodene.data.Field
com.penguinwerks.jodene.data.TranslatedField
- All Implemented Interfaces:
- java.io.Serializable
- public class TranslatedField
- extends Field
- implements java.io.Serializable
A translation is what happens to an input field that is not real valued.
For example, color might be a translated field. The translator implements
the actual translation. For example, K classes as K output values, N classes
as N - 1 output values, thermometer encoding, etc.
- Author:
- Paul Hoehne
- See Also:
- Serialized Form
|
Method Summary |
Translator |
getTranslator()
The translator that actually translates the value. |
double[] |
process(java.lang.String val)
Processes the input value by returning the translated value. |
void |
setTranslator(Translator translator)
The translator that actually translates the value. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TranslatedField
public TranslatedField()
getTranslator
public Translator getTranslator()
- The translator that actually translates the value.
- Returns:
- Returns the translator.
setTranslator
public void setTranslator(Translator translator)
- The translator that actually translates the value.
- Parameters:
translator - The translator to set.
process
public double[] process(java.lang.String val)
throws TranslatorException
- Processes the input value by returning the translated value.
- Specified by:
process in class Field
- Parameters:
val - Value as a string
- Returns:
- The values represented by the string.
- Throws:
TranslatorException - Thrown if there is an error in translation.