5.1.1.2.1.3.1.4. pycropml.transpiler.rules.javaRules module

class pycropml.transpiler.rules.javaRules.JavaRules[source]

Bases: pycropml.transpiler.rules.generalRule.GeneralRule

binary_op = {'!=': '!=', '*': '*', '+': '+', '-': '-', '/': '/', '<': '<', '<=': '<=', '==': '==', '>': '>', '>=': '>=', 'and': '&&', 'not': '!', 'or': '||'}
constructor = '\n public %s()\n {\n \n }'
copy_constr = '\n public %s(%s toCopy, boolean copyAll) // copy constructor \n {\n if (copyAll)\n {'
copy_constrArray = '\n for (int i = 0; i < %s; i++)\n {\n _%s[i] = toCopy._%s[i];\n }'
copy_constrList = '\n for (%s c : toCopy.%s)\n {\n _%s.add(c);\n }\n this.%s = _%s;'
copy_constr_compo = '\n public %s(%s toCopy) // copy constructor \n {'
functions = {'datetime': {'datetime': 'format.parse'}, 'math': {'acos': 'Math.acos', 'asin': 'Math.asin', 'atan': 'Math.atan', 'ceil': 'Math.ceil', 'cos': 'Math.cos', 'exp': 'Math.exp', 'ln': 'Math.log', 'log': 'Math.log', 'pow': 'Math.pow', 'round': 'Math.round', 'sin': 'Math.sin', 'sqrt': 'Math.sqrt', 'tan': 'Math.tan'}, 'system': {'abs': 'Math.abs', 'max': 'Math.max', 'min': 'Math.min', 'pow': 'Math.pow'}}
get_properties = '\n {\n return %s;\n }'
get_properties_compo = '\n {\n return _%s.get%s();\n }'
methods = {'array': {'append': '.add', 'len': <function translateLenArray>}, 'dict': {'get': '.get', 'keys': <function translateDictkeys>, 'len': <function translateLenDict>}, 'float': {'float': '(double)', 'int': '(int)'}, 'int': {'float': '(double)'}, 'list': {'append': '.add', 'contains?': '.contains', 'index': '.indexOf', 'insert_at': '.insert', 'len': <function translateLenList>, 'not contains?': <function translateNotContains>, 'pop': '.remove', 'sum': <function translateSum>}, 'str': {'find': '.IndexOf', 'float': 'Double.', 'int': '(int)'}}
set_properties = '\n {\n this.%s= _%s;\n } \n '
set_properties_compo = '\n {\n %s\n } '
types = {'array': '%s[] %s= new %s', 'bool': 'boolean', 'datetime': 'Date', 'dict': 'TreeMap', 'float': 'double', 'int': 'int', 'list': 'List', 'str': 'String', 'tuple': 'Tuple'}
types2 = {'Date': 'Date', 'bool': 'Boolean', 'datetime': 'Date', 'float': 'Double', 'int': 'Integer', 'str': 'String'}
unary_op = {'+': '+', '-': '-', 'not': '!', '~': '~'}
pycropml.transpiler.rules.javaRules.argsToStr(args)[source]
pycropml.transpiler.rules.javaRules.trans_format_parse(node)[source]
pycropml.transpiler.rules.javaRules.translateDictkeys(node)[source]
pycropml.transpiler.rules.javaRules.translateLenArray(node)[source]
pycropml.transpiler.rules.javaRules.translateLenDict(node)[source]
pycropml.transpiler.rules.javaRules.translateLenList(node)[source]
pycropml.transpiler.rules.javaRules.translateNotContains(node)[source]
pycropml.transpiler.rules.javaRules.translateSum(node)[source]