Merge branch 'master' of https://source.jalview.org/git/jalviewjs.git
[jalviewjs.git] / site / swingjs / j2s / java / lang / ThreadGroup.js
index b6e3356..1b9002c 100644 (file)
-Clazz.declarePackage ("java.lang");\r
-Clazz.load (["java.lang.Thread"], "java.lang.ThreadGroup", ["java.lang.IllegalThreadStateException", "$.ThreadDeath", "java.util.Arrays"], function () {\r
-c$ = Clazz.decorateAsClass (function () {\r
-this.parent = null;\r
-this.name = null;\r
-this.maxPriority = 10;\r
-this.destroyed = false;\r
-this.daemon = false;\r
-this.vmAllowSuspension = false;\r
-this.nUnstartedThreads = 0;\r
-this.nthreads = 0;\r
-this.threads = null;\r
-this.ngroups = 0;\r
-this.groups = null;\r
-this.html5Applet = null;\r
-Clazz.instantialize (this, arguments);\r
-}, java.lang, "ThreadGroup", null, java.lang.Thread.UncaughtExceptionHandler);\r
-Clazz.makeConstructor (c$, \r
-function (name) {\r
-this.construct (java.lang.Thread.currentThread ().getThreadGroup (), name);\r
-}, "~S");\r
-Clazz.makeConstructor (c$, \r
-function (parent, name) {\r
-this.name = name;\r
-this.parent = parent;\r
-if (parent != null) {\r
-this.maxPriority = parent.maxPriority;\r
-this.daemon = parent.daemon;\r
-this.vmAllowSuspension = parent.vmAllowSuspension;\r
-parent.add (this);\r
-}}, "java.lang.ThreadGroup,~S");\r
-Clazz.defineMethod (c$, "getName", \r
-function () {\r
-return this.name;\r
-});\r
-Clazz.defineMethod (c$, "getParent", \r
-function () {\r
-if (this.parent != null) this.parent.checkAccess ();\r
-return this.parent;\r
-});\r
-Clazz.defineMethod (c$, "getMaxPriority", \r
-function () {\r
-return this.maxPriority;\r
-});\r
-Clazz.defineMethod (c$, "isDaemon", \r
-function () {\r
-return this.daemon;\r
-});\r
-Clazz.defineMethod (c$, "isDestroyed", \r
-function () {\r
-return this.destroyed;\r
-});\r
-Clazz.defineMethod (c$, "setDaemon", \r
-function (daemon) {\r
-this.checkAccess ();\r
-this.daemon = daemon;\r
-}, "~B");\r
-Clazz.defineMethod (c$, "setMaxPriority", \r
-function (pri) {\r
-var ngroupsSnapshot;\r
-var groupsSnapshot;\r
-{\r
-this.checkAccess ();\r
-if (pri < 1 || pri > 10) {\r
-return;\r
-}this.maxPriority = (this.parent != null) ? Math.min (pri, this.parent.maxPriority) : pri;\r
-ngroupsSnapshot = this.ngroups;\r
-if (this.groups != null) {\r
-groupsSnapshot = java.util.Arrays.copyOf (this.groups, ngroupsSnapshot);\r
-} else {\r
-groupsSnapshot = null;\r
-}}for (var i = 0; i < ngroupsSnapshot; i++) {\r
-groupsSnapshot[i].setMaxPriority (pri);\r
-}\r
-}, "~N");\r
-Clazz.defineMethod (c$, "parentOf", \r
-function (g) {\r
-for (; g != null; g = g.parent) {\r
-if (g === this) {\r
-return true;\r
-}}\r
-return false;\r
-}, "java.lang.ThreadGroup");\r
-Clazz.defineMethod (c$, "checkAccess", \r
-function () {\r
-});\r
-Clazz.defineMethod (c$, "activeCount", \r
-function () {\r
-var result;\r
-var ngroupsSnapshot;\r
-var groupsSnapshot;\r
-{\r
-if (this.destroyed) {\r
-return 0;\r
-}result = this.nthreads;\r
-ngroupsSnapshot = this.ngroups;\r
-if (this.groups != null) {\r
-groupsSnapshot = java.util.Arrays.copyOf (this.groups, ngroupsSnapshot);\r
-} else {\r
-groupsSnapshot = null;\r
-}}for (var i = 0; i < ngroupsSnapshot; i++) {\r
-result += groupsSnapshot[i].activeCount ();\r
-}\r
-return result;\r
-});\r
-Clazz.defineMethod (c$, "enumerate", \r
-function (list) {\r
-this.checkAccess ();\r
-return this.enumerate (list, 0, true);\r
-}, "~A");\r
-Clazz.defineMethod (c$, "enumerate", \r
-function (list, recurse) {\r
-this.checkAccess ();\r
-return this.enumerate (list, 0, recurse);\r
-}, "~A,~B");\r
-Clazz.defineMethod (c$, "enumerate", \r
- function (list, n, recurse) {\r
-var ngroupsSnapshot = 0;\r
-var groupsSnapshot = null;\r
-{\r
-if (this.destroyed) {\r
-return 0;\r
-}var nt = this.nthreads;\r
-if (nt > list.length - n) {\r
-nt = list.length - n;\r
-}for (var i = 0; i < nt; i++) {\r
-if (this.threads[i].isAlive ()) {\r
-list[n++] = this.threads[i];\r
-}}\r
-if (recurse) {\r
-ngroupsSnapshot = this.ngroups;\r
-if (this.groups != null) {\r
-groupsSnapshot = java.util.Arrays.copyOf (this.groups, ngroupsSnapshot);\r
-} else {\r
-groupsSnapshot = null;\r
-}}}if (recurse) {\r
-for (var i = 0; i < ngroupsSnapshot; i++) {\r
-n = groupsSnapshot[i].enumerate (list, n, true);\r
-}\r
-}return n;\r
-}, "~A,~N,~B");\r
-Clazz.defineMethod (c$, "activeGroupCount", \r
-function () {\r
-var ngroupsSnapshot;\r
-var groupsSnapshot;\r
-{\r
-if (this.destroyed) {\r
-return 0;\r
-}ngroupsSnapshot = this.ngroups;\r
-if (this.groups != null) {\r
-groupsSnapshot = java.util.Arrays.copyOf (this.groups, ngroupsSnapshot);\r
-} else {\r
-groupsSnapshot = null;\r
-}}var n = ngroupsSnapshot;\r
-for (var i = 0; i < ngroupsSnapshot; i++) {\r
-n += groupsSnapshot[i].activeGroupCount ();\r
-}\r
-return n;\r
-});\r
-Clazz.defineMethod (c$, "enumerate", \r
-function (list) {\r
-this.checkAccess ();\r
-return this.enumerate (list, 0, true);\r
-}, "~A");\r
-Clazz.defineMethod (c$, "enumerate", \r
-function (list, recurse) {\r
-this.checkAccess ();\r
-return this.enumerate (list, 0, recurse);\r
-}, "~A,~B");\r
-Clazz.defineMethod (c$, "enumerate", \r
- function (list, n, recurse) {\r
-var ngroupsSnapshot = 0;\r
-var groupsSnapshot = null;\r
-{\r
-if (this.destroyed) {\r
-return 0;\r
-}var ng = this.ngroups;\r
-if (ng > list.length - n) {\r
-ng = list.length - n;\r
-}if (ng > 0) {\r
-System.arraycopy (this.groups, 0, list, n, ng);\r
-n += ng;\r
-}if (recurse) {\r
-ngroupsSnapshot = this.ngroups;\r
-if (this.groups != null) {\r
-groupsSnapshot = java.util.Arrays.copyOf (this.groups, ngroupsSnapshot);\r
-} else {\r
-groupsSnapshot = null;\r
-}}}if (recurse) {\r
-for (var i = 0; i < ngroupsSnapshot; i++) {\r
-n = groupsSnapshot[i].enumerate (list, n, true);\r
-}\r
-}return n;\r
-}, "~A,~N,~B");\r
-Clazz.defineMethod (c$, "stop", \r
-function () {\r
-if (this.stopOrSuspend (false)) java.lang.Thread.currentThread ().stop ();\r
-});\r
-Clazz.defineMethod (c$, "interrupt", \r
-function () {\r
-var ngroupsSnapshot;\r
-var groupsSnapshot;\r
-{\r
-this.checkAccess ();\r
-for (var i = 0; i < this.nthreads; i++) {\r
-this.threads[i].interrupt ();\r
-}\r
-ngroupsSnapshot = this.ngroups;\r
-if (this.groups != null) {\r
-groupsSnapshot = java.util.Arrays.copyOf (this.groups, ngroupsSnapshot);\r
-} else {\r
-groupsSnapshot = null;\r
-}}for (var i = 0; i < ngroupsSnapshot; i++) {\r
-groupsSnapshot[i].interrupt ();\r
-}\r
-});\r
-Clazz.defineMethod (c$, "suspend", \r
-function () {\r
-if (this.stopOrSuspend (true)) java.lang.Thread.currentThread ().suspend ();\r
-});\r
-Clazz.defineMethod (c$, "stopOrSuspend", \r
- function (suspend) {\r
-var suicide = false;\r
-var us = java.lang.Thread.currentThread ();\r
-var ngroupsSnapshot;\r
-var groupsSnapshot = null;\r
-{\r
-this.checkAccess ();\r
-for (var i = 0; i < this.nthreads; i++) {\r
-if (this.threads[i] === us) suicide = true;\r
- else if (suspend) this.threads[i].suspend ();\r
- else this.threads[i].stop ();\r
-}\r
-ngroupsSnapshot = this.ngroups;\r
-if (this.groups != null) {\r
-groupsSnapshot = java.util.Arrays.copyOf (this.groups, ngroupsSnapshot);\r
-}}for (var i = 0; i < ngroupsSnapshot; i++) suicide = groupsSnapshot[i].stopOrSuspend (suspend) || suicide;\r
-\r
-return suicide;\r
-}, "~B");\r
-Clazz.defineMethod (c$, "resume", \r
-function () {\r
-var ngroupsSnapshot;\r
-var groupsSnapshot;\r
-{\r
-this.checkAccess ();\r
-for (var i = 0; i < this.nthreads; i++) {\r
-this.threads[i].resume ();\r
-}\r
-ngroupsSnapshot = this.ngroups;\r
-if (this.groups != null) {\r
-groupsSnapshot = java.util.Arrays.copyOf (this.groups, ngroupsSnapshot);\r
-} else {\r
-groupsSnapshot = null;\r
-}}for (var i = 0; i < ngroupsSnapshot; i++) {\r
-groupsSnapshot[i].resume ();\r
-}\r
-});\r
-Clazz.defineMethod (c$, "destroy", \r
-function () {\r
-var ngroupsSnapshot;\r
-var groupsSnapshot;\r
-{\r
-this.checkAccess ();\r
-if (this.destroyed || (this.nthreads > 0)) {\r
-throw  new IllegalThreadStateException ();\r
-}ngroupsSnapshot = this.ngroups;\r
-if (this.groups != null) {\r
-groupsSnapshot = java.util.Arrays.copyOf (this.groups, ngroupsSnapshot);\r
-} else {\r
-groupsSnapshot = null;\r
-}if (this.parent != null) {\r
-this.destroyed = true;\r
-this.ngroups = 0;\r
-this.groups = null;\r
-this.nthreads = 0;\r
-this.threads = null;\r
-}}for (var i = 0; i < ngroupsSnapshot; i += 1) {\r
-groupsSnapshot[i].destroy ();\r
-}\r
-if (this.parent != null) {\r
-this.parent.remove (this);\r
-}});\r
-Clazz.defineMethod (c$, "add", \r
- function (g) {\r
-{\r
-if (this.destroyed) {\r
-throw  new IllegalThreadStateException ();\r
-}if (this.groups == null) {\r
-this.groups =  new Array (4);\r
-} else if (this.ngroups == this.groups.length) {\r
-this.groups = java.util.Arrays.copyOf (this.groups, this.ngroups * 2);\r
-}this.groups[this.ngroups] = g;\r
-this.ngroups++;\r
-}}, "java.lang.ThreadGroup");\r
-Clazz.defineMethod (c$, "remove", \r
- function (g) {\r
-{\r
-if (this.destroyed) {\r
-return;\r
-}for (var i = 0; i < this.ngroups; i++) {\r
-if (this.groups[i] === g) {\r
-this.ngroups -= 1;\r
-System.arraycopy (this.groups, i + 1, this.groups, i, this.ngroups - i);\r
-this.groups[this.ngroups] = null;\r
-break;\r
-}}\r
-if (this.nthreads == 0) {\r
-this.notifyAll ();\r
-}if (this.daemon && (this.nthreads == 0) && (this.nUnstartedThreads == 0) && (this.ngroups == 0)) {\r
-this.destroy ();\r
-}}}, "java.lang.ThreadGroup");\r
-Clazz.defineMethod (c$, "addUnstarted", \r
-function () {\r
-{\r
-if (this.destroyed) {\r
-throw  new IllegalThreadStateException ();\r
-}this.nUnstartedThreads++;\r
-}});\r
-Clazz.defineMethod (c$, "add", \r
-function (t) {\r
-{\r
-if (this.destroyed) {\r
-throw  new IllegalThreadStateException ();\r
-}if (this.threads == null) {\r
-this.threads =  new Array (4);\r
-} else if (this.nthreads == this.threads.length) {\r
-this.threads = java.util.Arrays.copyOf (this.threads, this.nthreads * 2);\r
-}this.threads[this.nthreads] = t;\r
-this.nthreads++;\r
-this.nUnstartedThreads--;\r
-}}, "java.lang.Thread");\r
-Clazz.defineMethod (c$, "remove", \r
-function (t) {\r
-{\r
-if (this.destroyed) {\r
-return;\r
-}for (var i = 0; i < this.nthreads; i++) {\r
-if (this.threads[i] === t) {\r
-System.arraycopy (this.threads, i + 1, this.threads, i, --this.nthreads - i);\r
-this.threads[this.nthreads] = null;\r
-break;\r
-}}\r
-if (this.nthreads == 0) {\r
-this.notifyAll ();\r
-}if (this.daemon && (this.nthreads == 0) && (this.nUnstartedThreads == 0) && (this.ngroups == 0)) {\r
-this.destroy ();\r
-}}}, "java.lang.Thread");\r
-Clazz.defineMethod (c$, "uncaughtException", \r
-function (t, e) {\r
-if (this.parent != null) {\r
-this.parent.uncaughtException (t, e);\r
-} else {\r
-var ueh = java.lang.Thread.getDefaultUncaughtExceptionHandler ();\r
-if (ueh != null) {\r
-ueh.uncaughtException (t, e);\r
-} else if (!(Clazz.instanceOf (e, ThreadDeath))) {\r
-System.err.print ("Exception in thread \"" + t.getName () + "\" ");\r
-e.printStackTrace (System.err);\r
-}}}, "java.lang.Thread,Throwable");\r
-Clazz.overrideMethod (c$, "toString", \r
-function () {\r
-return this.getClass ().getName () + "[name=" + this.getName () + ",maxpri=" + this.maxPriority + ",html5Applet=" + this.html5Applet + "]";\r
-});\r
-});\r
+Clazz.declarePackage ("java.lang");
+Clazz.load (["java.lang.Thread"], "java.lang.ThreadGroup", ["java.lang.IllegalThreadStateException", "$.ThreadDeath", "java.util.Arrays"], function () {
+c$ = Clazz.decorateAsClass (function () {
+this.parent = null;
+this.name = null;
+this.maxPriority = 10;
+this.destroyed = false;
+this.daemon = false;
+this.vmAllowSuspension = false;
+this.nUnstartedThreads = 0;
+this.nthreads = 0;
+this.threads = null;
+this.ngroups = 0;
+this.groups = null;
+this.html5Applet = null;
+Clazz.instantialize (this, arguments);
+}, java.lang, "ThreadGroup", null, java.lang.Thread.UncaughtExceptionHandler);
+Clazz.makeConstructor (c$, 
+function (name) {
+this.construct (java.lang.Thread.currentThread ().getThreadGroup (), name);
+}, "~S");
+Clazz.makeConstructor (c$, 
+function (parent, name) {
+this.name = name;
+this.parent = parent;
+if (parent != null) {
+this.maxPriority = parent.maxPriority;
+this.daemon = parent.daemon;
+this.vmAllowSuspension = parent.vmAllowSuspension;
+parent.add (this);
+}}, "java.lang.ThreadGroup,~S");
+Clazz.defineMethod (c$, "getName", 
+function () {
+return this.name;
+});
+Clazz.defineMethod (c$, "getParent", 
+function () {
+if (this.parent != null) this.parent.checkAccess ();
+return this.parent;
+});
+Clazz.defineMethod (c$, "getMaxPriority", 
+function () {
+return this.maxPriority;
+});
+Clazz.defineMethod (c$, "isDaemon", 
+function () {
+return this.daemon;
+});
+Clazz.defineMethod (c$, "isDestroyed", 
+function () {
+return this.destroyed;
+});
+Clazz.defineMethod (c$, "setDaemon", 
+function (daemon) {
+this.checkAccess ();
+this.daemon = daemon;
+}, "~B");
+Clazz.defineMethod (c$, "setMaxPriority", 
+function (pri) {
+var ngroupsSnapshot;
+var groupsSnapshot;
+{
+this.checkAccess ();
+if (pri < 1 || pri > 10) {
+return;
+}this.maxPriority = (this.parent != null) ? Math.min (pri, this.parent.maxPriority) : pri;
+ngroupsSnapshot = this.ngroups;
+if (this.groups != null) {
+groupsSnapshot = java.util.Arrays.copyOf (this.groups, ngroupsSnapshot);
+} else {
+groupsSnapshot = null;
+}}for (var i = 0; i < ngroupsSnapshot; i++) {
+groupsSnapshot[i].setMaxPriority (pri);
+}
+}, "~N");
+Clazz.defineMethod (c$, "parentOf", 
+function (g) {
+for (; g != null; g = g.parent) {
+if (g === this) {
+return true;
+}}
+return false;
+}, "java.lang.ThreadGroup");
+Clazz.defineMethod (c$, "checkAccess", 
+function () {
+});
+Clazz.defineMethod (c$, "activeCount", 
+function () {
+var result;
+var ngroupsSnapshot;
+var groupsSnapshot;
+{
+if (this.destroyed) {
+return 0;
+}result = this.nthreads;
+ngroupsSnapshot = this.ngroups;
+if (this.groups != null) {
+groupsSnapshot = java.util.Arrays.copyOf (this.groups, ngroupsSnapshot);
+} else {
+groupsSnapshot = null;
+}}for (var i = 0; i < ngroupsSnapshot; i++) {
+result += groupsSnapshot[i].activeCount ();
+}
+return result;
+});
+Clazz.defineMethod (c$, "enumerate", 
+function (list) {
+this.checkAccess ();
+return this.enumerate (list, 0, true);
+}, "~A");
+Clazz.defineMethod (c$, "enumerate", 
+function (list, recurse) {
+this.checkAccess ();
+return this.enumerate (list, 0, recurse);
+}, "~A,~B");
+Clazz.defineMethod (c$, "enumerate", 
+ function (list, n, recurse) {
+var ngroupsSnapshot = 0;
+var groupsSnapshot = null;
+{
+if (this.destroyed) {
+return 0;
+}var nt = this.nthreads;
+if (nt > list.length - n) {
+nt = list.length - n;
+}for (var i = 0; i < nt; i++) {
+if (this.threads[i].isAlive ()) {
+list[n++] = this.threads[i];
+}}
+if (recurse) {
+ngroupsSnapshot = this.ngroups;
+if (this.groups != null) {
+groupsSnapshot = java.util.Arrays.copyOf (this.groups, ngroupsSnapshot);
+} else {
+groupsSnapshot = null;
+}}}if (recurse) {
+for (var i = 0; i < ngroupsSnapshot; i++) {
+n = groupsSnapshot[i].enumerate (list, n, true);
+}
+}return n;
+}, "~A,~N,~B");
+Clazz.defineMethod (c$, "activeGroupCount", 
+function () {
+var ngroupsSnapshot;
+var groupsSnapshot;
+{
+if (this.destroyed) {
+return 0;
+}ngroupsSnapshot = this.ngroups;
+if (this.groups != null) {
+groupsSnapshot = java.util.Arrays.copyOf (this.groups, ngroupsSnapshot);
+} else {
+groupsSnapshot = null;
+}}var n = ngroupsSnapshot;
+for (var i = 0; i < ngroupsSnapshot; i++) {
+n += groupsSnapshot[i].activeGroupCount ();
+}
+return n;
+});
+Clazz.defineMethod (c$, "enumerate", 
+function (list) {
+this.checkAccess ();
+return this.enumerate (list, 0, true);
+}, "~A");
+Clazz.defineMethod (c$, "enumerate", 
+function (list, recurse) {
+this.checkAccess ();
+return this.enumerate (list, 0, recurse);
+}, "~A,~B");
+Clazz.defineMethod (c$, "enumerate", 
+ function (list, n, recurse) {
+var ngroupsSnapshot = 0;
+var groupsSnapshot = null;
+{
+if (this.destroyed) {
+return 0;
+}var ng = this.ngroups;
+if (ng > list.length - n) {
+ng = list.length - n;
+}if (ng > 0) {
+System.arraycopy (this.groups, 0, list, n, ng);
+n += ng;
+}if (recurse) {
+ngroupsSnapshot = this.ngroups;
+if (this.groups != null) {
+groupsSnapshot = java.util.Arrays.copyOf (this.groups, ngroupsSnapshot);
+} else {
+groupsSnapshot = null;
+}}}if (recurse) {
+for (var i = 0; i < ngroupsSnapshot; i++) {
+n = groupsSnapshot[i].enumerate (list, n, true);
+}
+}return n;
+}, "~A,~N,~B");
+Clazz.defineMethod (c$, "stop", 
+function () {
+if (this.stopOrSuspend (false)) java.lang.Thread.currentThread ().stop ();
+});
+Clazz.defineMethod (c$, "interrupt", 
+function () {
+var ngroupsSnapshot;
+var groupsSnapshot;
+{
+this.checkAccess ();
+for (var i = 0; i < this.nthreads; i++) {
+this.threads[i].interrupt ();
+}
+ngroupsSnapshot = this.ngroups;
+if (this.groups != null) {
+groupsSnapshot = java.util.Arrays.copyOf (this.groups, ngroupsSnapshot);
+} else {
+groupsSnapshot = null;
+}}for (var i = 0; i < ngroupsSnapshot; i++) {
+groupsSnapshot[i].interrupt ();
+}
+});
+Clazz.defineMethod (c$, "suspend", 
+function () {
+if (this.stopOrSuspend (true)) java.lang.Thread.currentThread ().suspend ();
+});
+Clazz.defineMethod (c$, "stopOrSuspend", 
+ function (suspend) {
+var suicide = false;
+var us = java.lang.Thread.currentThread ();
+var ngroupsSnapshot;
+var groupsSnapshot = null;
+{
+this.checkAccess ();
+for (var i = 0; i < this.nthreads; i++) {
+if (this.threads[i] === us) suicide = true;
+ else if (suspend) this.threads[i].suspend ();
+ else this.threads[i].stop ();
+}
+ngroupsSnapshot = this.ngroups;
+if (this.groups != null) {
+groupsSnapshot = java.util.Arrays.copyOf (this.groups, ngroupsSnapshot);
+}}for (var i = 0; i < ngroupsSnapshot; i++) suicide = groupsSnapshot[i].stopOrSuspend (suspend) || suicide;
+
+return suicide;
+}, "~B");
+Clazz.defineMethod (c$, "resume", 
+function () {
+var ngroupsSnapshot;
+var groupsSnapshot;
+{
+this.checkAccess ();
+for (var i = 0; i < this.nthreads; i++) {
+this.threads[i].resume ();
+}
+ngroupsSnapshot = this.ngroups;
+if (this.groups != null) {
+groupsSnapshot = java.util.Arrays.copyOf (this.groups, ngroupsSnapshot);
+} else {
+groupsSnapshot = null;
+}}for (var i = 0; i < ngroupsSnapshot; i++) {
+groupsSnapshot[i].resume ();
+}
+});
+Clazz.defineMethod (c$, "destroy", 
+function () {
+var ngroupsSnapshot;
+var groupsSnapshot;
+{
+this.checkAccess ();
+if (this.destroyed || (this.nthreads > 0)) {
+throw  new IllegalThreadStateException ();
+}ngroupsSnapshot = this.ngroups;
+if (this.groups != null) {
+groupsSnapshot = java.util.Arrays.copyOf (this.groups, ngroupsSnapshot);
+} else {
+groupsSnapshot = null;
+}if (this.parent != null) {
+this.destroyed = true;
+this.ngroups = 0;
+this.groups = null;
+this.nthreads = 0;
+this.threads = null;
+}}for (var i = 0; i < ngroupsSnapshot; i += 1) {
+groupsSnapshot[i].destroy ();
+}
+if (this.parent != null) {
+this.parent.remove (this);
+}});
+Clazz.defineMethod (c$, "add", 
+ function (g) {
+{
+if (this.destroyed) {
+throw  new IllegalThreadStateException ();
+}if (this.groups == null) {
+this.groups =  new Array (4);
+} else if (this.ngroups == this.groups.length) {
+this.groups = java.util.Arrays.copyOf (this.groups, this.ngroups * 2);
+}this.groups[this.ngroups] = g;
+this.ngroups++;
+}}, "java.lang.ThreadGroup");
+Clazz.defineMethod (c$, "remove", 
+ function (g) {
+{
+if (this.destroyed) {
+return;
+}for (var i = 0; i < this.ngroups; i++) {
+if (this.groups[i] === g) {
+this.ngroups -= 1;
+System.arraycopy (this.groups, i + 1, this.groups, i, this.ngroups - i);
+this.groups[this.ngroups] = null;
+break;
+}}
+if (this.nthreads == 0) {
+this.notifyAll ();
+}if (this.daemon && (this.nthreads == 0) && (this.nUnstartedThreads == 0) && (this.ngroups == 0)) {
+this.destroy ();
+}}}, "java.lang.ThreadGroup");
+Clazz.defineMethod (c$, "addUnstarted", 
+function () {
+{
+if (this.destroyed) {
+throw  new IllegalThreadStateException ();
+}this.nUnstartedThreads++;
+}});
+Clazz.defineMethod (c$, "add", 
+function (t) {
+{
+if (this.destroyed) {
+throw  new IllegalThreadStateException ();
+}if (this.threads == null) {
+this.threads =  new Array (4);
+} else if (this.nthreads == this.threads.length) {
+this.threads = java.util.Arrays.copyOf (this.threads, this.nthreads * 2);
+}this.threads[this.nthreads] = t;
+this.nthreads++;
+this.nUnstartedThreads--;
+}}, "java.lang.Thread");
+Clazz.defineMethod (c$, "remove", 
+function (t) {
+{
+if (this.destroyed) {
+return;
+}for (var i = 0; i < this.nthreads; i++) {
+if (this.threads[i] === t) {
+System.arraycopy (this.threads, i + 1, this.threads, i, --this.nthreads - i);
+this.threads[this.nthreads] = null;
+break;
+}}
+if (this.nthreads == 0) {
+this.notifyAll ();
+}if (this.daemon && (this.nthreads == 0) && (this.nUnstartedThreads == 0) && (this.ngroups == 0)) {
+this.destroy ();
+}}}, "java.lang.Thread");
+Clazz.defineMethod (c$, "uncaughtException", 
+function (t, e) {
+if (this.parent != null) {
+this.parent.uncaughtException (t, e);
+} else {
+var ueh = java.lang.Thread.getDefaultUncaughtExceptionHandler ();
+if (ueh != null) {
+ueh.uncaughtException (t, e);
+} else if (!(Clazz.instanceOf (e, ThreadDeath))) {
+System.err.print ("Exception in thread \"" + t.getName () + "\" ");
+e.printStackTrace (System.err);
+}}}, "java.lang.Thread,Throwable");
+Clazz.overrideMethod (c$, "toString", 
+function () {
+return this.getClass ().getName () + "[name=" + this.getName () + ",maxpri=" + this.maxPriority + ",html5Applet=" + this.html5Applet + "]";
+});
+});