Skip to content

Commit 11de554

Browse files
committed
Added Runnable to set of implemented interfaces
1 parent 358610f commit 11de554

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

JavaProjectGenerator/src/de/loskutov/jpg/Clazz.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,14 @@ String generateMethods(String type) {
7676
"\t \t this.element = ("+type+")element;\n" +
7777
"\t \t " + extend + ".getInstance" + suffix + "().set" + suffix + "(this.element);\n" +
7878
"\t }\n\n" +
79+
"\t public void run" + suffix + "() {\n" +
80+
"\t \t try {\n" +
81+
"\t \t \t this.call" + suffix + "();\n" +
82+
"\t \t } catch (Exception e) {}\n" +
83+
"\t \t " + extend + ".getInstance" + suffix + "().run();\n" +
84+
"\t }\n\n" +
7985
"\t public "+type+" call" + suffix + "() throws Exception {\n" +
86+
"\t \t " + extend + ".getInstance" + suffix + "().run();\n" +
8087
"\t \t return ("+type+")" + extend + ".getInstance" + suffix + "().call" + suffix + "();\n" +
8188
"\t }\n";
8289
sb.append(result);

JavaProjectGenerator/src/de/loskutov/jpg/Interface.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ String generateCode() {
2626
String generateTypeDefinition(String type) {
2727
if(useExtend) {
2828
return "@SuppressWarnings(\"all\")\n" +
29-
"public interface " + name + "<"+type+"> extends " + extend + "<"+type+"> ";
29+
"public interface " + name + "<"+type+"> extends " + extend + "<"+type+">, Runnable ";
3030
}
3131
return "@SuppressWarnings(\"all\")\n" +
3232
"public interface " + name + "<"+type+"> ";

0 commit comments

Comments
 (0)