def __str__(self):
c = ''
c += 'public static final class State' + self._idx + '<T>'
c += ' extends {}'.format(self._name) if self._extends else ''
c += ' {\n\n'
c += ' final Context$ context;\n\n'
c += ' State' + self._idx + '(Context$ context) {\n'
c += ' this.context = context;\n'
c += ' }\n\n'
if self._extends:
c += ' Context$ context() {\n'
c += ' return context;\n'
c += ' }\n\n'
for m in sorted(self._methods):
c += indent(str(m), ' ') + '\n\n'
c += '}'
return c
评论列表
文章目录