@@ -0,0 +1,1892 @@
+/**%0D%0A * Copyright 2005-2007 Yu Zhang%0D%0A * Distributed under the GNU General Public License 2.0%0D%0A */%0D%0A%0D%0Apackage com.xruby.runtime.builtin;%0D%0A%0D%0Aimport java.util.Iterator;%0D%0Aimport java.util.List;%0D%0A%0D%0Aimport com.xruby.runtime.lang.RubyBlock;%0D%0Aimport com.xruby.runtime.lang.RubyClass;%0D%0Aimport com.xruby.runtime.lang.RubyNoArgMethod;%0D%0Aimport com.xruby.runtime.lang.RubyOneArgMethod;%0D%0Aimport com.xruby.runtime.lang.RubyRuntime;%0D%0Aimport com.xruby.runtime.lang.RubyValue;%0D%0Aimport com.xruby.runtime.value.RubyArray;%0D%0Aimport com.xruby.runtime.value.RubyThread;%0D%0Aimport com.xruby.runtime.value.RubyThreadGroup;%0D%0A%0D%0Aclass ThreadGroup_list extends RubyNoArgMethod %7B%0D%0A    protected RubyValue run(RubyValue receiver, RubyBlock block) %7B%0D%0A        RubyThreadGroup group = (RubyThreadGroup)receiver;%0D%0A        List list = group.list();%0D%0A        Iterator iter = list.iterator();%0D%0A        RubyArray result = new RubyArray(0);%0D%0A        while(iter.hasNext())%7B%0D%0A            result.add((RubyThread)iter.next());%0D%0A        %7D%0D%0A        return result;%0D%0A    %7D%0D%0A%7D%0D%0A%0D%0Aclass ThreadGroup_new extends RubyNoArgMethod %7B%0D%0A    protected RubyValue run(RubyValue receiver, RubyBlock block) %7B%0D%0A        return new RubyThreadGroup();%0D%0A    %7D%0D%0A%7D%0D%0A%0D%0Aclass ThreadGroup_add extends RubyOneArgMethod %7B%0D%0A    protected RubyValue run(RubyValue receiver, RubyValue arg, RubyBlock block) %7B%0D%0A        RubyThread thread = (RubyThread)arg;%0D%0A        ((RubyThreadGroup)receiver).add(thread);%0D%0A        return receiver;%0D%0A    %7D%0D%0A%7D%0D%0A%0D%0Apublic class ThreadGroupClassBuilder %7B%0D%0A    public static void initialize() %7B%0D%0A        RubyClass c = RubyRuntime.ThreadGroupClass;             %0D%0A        c.defineMethod(%22add%22, new ThreadGroup_add());%0D%0A        c.defineMethod(%22list%22, new ThreadGroup_list());      %0D%0A        %0D%0A        c.setConstant(%22Default%22,RubyThreadGroup.defaultThreadGroup);%0D%0A        c.getSingletonClass().defineMethod(%22new%22, new ThreadGroup_new());%0D%0A    %7D%0D%0A%7D%0D%0A

add ThreadGroupClassBuilder