- All Known Implementing Classes:
- DataTranslatorVector, FrequencyToPitchTranslator
public interface DataTranslator
MusicJob and all subclasses have a DataTranslator field (which by default is NULL). DataTranslator converts one
array of double to another array of double.
MusicJob does not by default do anything with its DataTranslator, but
you can call it by hand and use it as you like.
MusicShape hardcodes this however: for each element, it calls DataTranslator.translate() , then
calls DimensionNameSpaceTranslator.translate(), then passes the result to its Instrument.
Your implementation should return a copy of the double passed in to ensure non-destructive translation. For example:
double newdar = new double[data.length];
System.arraycopy(data, 0, newdar, 0, data.length);
A reference to the MusicJob is provided in case your Translator wants to know from where it was called.
- Nick Didkovsky, email: email@example.com, (c) 2003 Nick Didkovsky, all rights reserved.
- See Also:
double translate(MusicJob job,