- out_java_struct += ("\tpublic " + return_type_info.java_hu_ty + " " + meth_n + "(")
- for idx, arg in enumerate(argument_types):
- if idx != 0:
- if not takes_self or idx > 1:
- out_java_struct += (", ")
- elif takes_self:
- continue
- if arg.java_ty != "void":
- if arg.arg_name in default_constructor_args:
- for explode_idx, explode_arg in enumerate(default_constructor_args[arg.arg_name]):
- if explode_idx != 0:
- out_java_struct += (", ")
- out_java_struct += (
- explode_arg.java_hu_ty + " " + arg.arg_name + "_" + explode_arg.arg_name)
- else:
- out_java_struct += (arg.java_hu_ty + " " + arg.arg_name)
+ out_java_struct += "\tpublic static " + return_type_info.java_hu_ty + " " + meth_n + "("
+ elif meth_n == "clone_ptr":
+ out_java_struct += ("\t" + return_type_info.java_hu_ty + " " + meth_n + "(")
+ else:
+ if meth_n == "hash" and return_type_info.java_hu_ty == "long":
+ extra_java_struct_out = "\t@Override public int hashCode() {\n"
+ extra_java_struct_out += "\t\treturn (int)this.hash();\n"
+ extra_java_struct_out += "\t}\n"
+ elif meth_n == "eq" and return_type_info.java_hu_ty == "boolean":
+ extra_java_struct_out = "\t@Override public boolean equals(Object o) {\n"
+ extra_java_struct_out += "\t\tif (!(o instanceof " + struct_meth + ")) return false;\n"
+ extra_java_struct_out += "\t\treturn this.eq((" + struct_meth + ")o);\n"
+ extra_java_struct_out += "\t}\n"
+ out_java_struct += ("\tpublic " + return_type_info.java_hu_ty + " " + meth_n + "(")
+ for idx, arg in enumerate(argument_types):
+ if idx != 0:
+ if not takes_self or idx > 1:
+ out_java_struct += ", "
+ elif takes_self:
+ continue
+ if arg.java_ty != "void":
+ if arg.arg_name in default_constructor_args:
+ assert not arg.nullable
+ for explode_idx, explode_arg in enumerate(default_constructor_args[arg.arg_name]):
+ if explode_idx != 0:
+ out_java_struct += (", ")
+ out_java_struct += (
+ explode_arg.java_hu_ty + " " + arg.arg_name + "_" + explode_arg.arg_name)
+ else:
+ if arg.nullable:
+ out_java_struct += "@Nullable "
+ ty_string = arg.java_hu_ty
+ if arg.java_fn_ty_arg[0] == "L" and arg.java_fn_ty_arg[len(arg.java_fn_ty_arg) - 1] == ";":
+ ty_string = arg.java_fn_ty_arg.strip("L;").replace("/", ".")
+ out_java_struct += ty_string + " " + arg.arg_name