34 | | The mechanism assumes a fixed mapping from java classes to python classes, as in the table below. Also it is assumed that the equivalent classes have roughly the same functionality, even if the actual function names and arguments may differ. This fixed mapping is needed to ensure the translator can be sure which classes will appear on the python side of the translation, so that proper actions can be taken to further the translation. |
| 34 | The mechanism is flexible in its mapping from java classes to python classes. |
| 35 | The general approach is to assume a fixed mapping from java classes to python classes, as in the table below. Also it is assumed that the equivalent classes have roughly the same functionality, even if the actual function names and arguments may differ. This fixed mapping simplifies translation. |
| 36 | |
| 37 | But the translator can intercept special classes and make dedicated translations. For instance if a class C is implementing {{{Iterator}}} and it is of class C, translating {{{it.next()}}} gives {{{next(it)}}}, and the definition {{{void iterator()}}} translates to {{{__iter__(self)}}}. |