# JAVA class translation 'COS_JDoor'
       # Thu Jun 30 17:00:10 EDT 2005
       # Produced by Fritzifier, based on JasminVisitor
       # Using BCEL library to read Java bytecode
       # Here is the original code:
       
       # public class COS_JDoor {
       #     private COS_JRoom src, dest;
       #     private String src_cmd, dest_cmd;
       
       #     public COS_JDoor(COS_JRoom src, String src_cmd,
       #                      COS_JRoom dest, String dest_cmd) {
       #         this.src = src;
       #         this.dest = dest;
       #         this.src_cmd = src_cmd;
       #         this.dest_cmd = dest_cmd;
       #         src.addDoor(this);
       #         dest.addDoor(this);
       #     }
       
       #     public COS_JRoom apply(COS_JRoom src, String cmd) {
       #         if (src == this.src) {
       #             if (src_cmd.equals(cmd)) {
       #                 return this.dest;
       #             }
       #         }
       #         if (src == this.dest) {
       #             if (dest_cmd.equals(cmd)) {
       #                 return this.src;
       #             }
       #         }
       #         return null;
       #     }
       
       #     public COS_JRoom apply(COS_JRoom src) {
       #         if (src==this.src) {
       #             return this.dest;
       #         }
       #         if (src==this.dest) {
       #             return this.src;
       #         }
       #         return null;
       #     }
       # }
[hear] (class COS_JDoor ()
          (field super-ref (make-cell 0))
          (method new (set! (super-ref) ((java lang Object) / this)))
          (method super (? x / (get! / super-ref) / x))
          (method unknown (? x / self super / x))
          (field src (cell new 0))
          (field dest (cell new 0))
          (field src_cmd (cell new 0))
          (field dest_cmd (cell new 0))
          (method <init>-COS_JRoom-String-COS_JRoom-String-V
            (lambda (arg0 arg1 arg2 arg3) /
             let ((vars / cell new / make-hash / vector
                           (pair 0 (self)) (pair 1 (arg0)) (pair 2 (arg1)) (pair 3 (arg2)) (pair 4 (arg3)))
                  (stack / cell new / vector)) /
             state-machine (vars) (stack) / ? jvm / ? x / cond
                ((= (x) 0) (jvm aload 0))
                ((= (x) 1) (jvm invokespecial <init>-V 0 0))
                ((= (x) 2) (jvm aload 0))
                ((= (x) 3) (jvm aload 1))
                ((= (x) 4) (jvm putfield src (COS_JRoom)))
                ((= (x) 5) (jvm aload 0))
                ((= (x) 6) (jvm aload 3))
                ((= (x) 7) (jvm putfield dest (COS_JRoom)))
                ((= (x) 8) (jvm aload 0))
                ((= (x) 9) (jvm aload 2))
                ((= (x) 10) (jvm putfield src_cmd (java lang String)))
                ((= (x) 11) (jvm aload 0))
                ((= (x) 12) (jvm aload 4))
                ((= (x) 13) (jvm putfield dest_cmd (java lang String)))
                ((= (x) 14) (jvm aload 1))
                ((= (x) 15) (jvm aload 0))
                ((= (x) 16) (jvm invokevirtual addDoor-COS_JDoor-V 1 0))
                ((= (x) 17) (jvm aload 3))
                ((= (x) 18) (jvm aload 0))
                ((= (x) 19) (jvm invokevirtual addDoor-COS_JDoor-V 1 0))
                ((= (x) 20) (jvm return))
                (jvm return))
          )
          (method <init> (self <init>-COS_JRoom-String-COS_JRoom-String-V))
          (method apply-COS_JRoom-String-COS_JRoom
            (lambda (arg0 arg1) /
             let ((vars / cell new / make-hash / vector
                           (pair 0 (self)) (pair 1 (arg0)) (pair 2 (arg1)))
                  (stack / cell new / vector)) /
             state-machine (vars) (stack) / ? jvm / ? x / cond
                ((= (x) 0) (jvm aload 1))
                ((= (x) 1) (jvm aload 0))
                ((= (x) 2) (jvm getfield src (COS_JRoom)))
                ((= (x) 3) (jvm if_acmpne 12))
                ((= (x) 4) (jvm aload 0))
                ((= (x) 5) (jvm getfield src_cmd (java lang String)))
                ((= (x) 6) (jvm aload 2))
                ((= (x) 7) (jvm invokevirtual equals-Object-Z 1 1))
                ((= (x) 8) (jvm ifeq 12))
                ((= (x) 9) (jvm aload 0))
                ((= (x) 10) (jvm getfield dest (COS_JRoom)))
                ((= (x) 11) (jvm areturn))
                ((= (x) 12) (jvm aload 1))
                ((= (x) 13) (jvm aload 0))
                ((= (x) 14) (jvm getfield dest (COS_JRoom)))
                ((= (x) 15) (jvm if_acmpne 24))
                ((= (x) 16) (jvm aload 0))
                ((= (x) 17) (jvm getfield dest_cmd (java lang String)))
                ((= (x) 18) (jvm aload 2))
                ((= (x) 19) (jvm invokevirtual equals-Object-Z 1 1))
                ((= (x) 20) (jvm ifeq 24))
                ((= (x) 21) (jvm aload 0))
                ((= (x) 22) (jvm getfield src (COS_JRoom)))
                ((= (x) 23) (jvm areturn))
                ((= (x) 24) (jvm aconst_null))
                ((= (x) 25) (jvm areturn))
                (jvm return))
          )
          (method apply (self apply-COS_JRoom-String-COS_JRoom))
          (method apply-COS_JRoom-COS_JRoom
            (lambda (arg0) /
             let ((vars / cell new / make-hash / vector
                           (pair 0 (self)) (pair 1 (arg0)))
                  (stack / cell new / vector)) /
             state-machine (vars) (stack) / ? jvm / ? x / cond
                ((= (x) 0) (jvm aload 1))
                ((= (x) 1) (jvm aload 0))
                ((= (x) 2) (jvm getfield src (COS_JRoom)))
                ((= (x) 3) (jvm if_acmpne 7))
                ((= (x) 4) (jvm aload 0))
                ((= (x) 5) (jvm getfield dest (COS_JRoom)))
                ((= (x) 6) (jvm areturn))
                ((= (x) 7) (jvm aload 1))
                ((= (x) 8) (jvm aload 0))
                ((= (x) 9) (jvm getfield dest (COS_JRoom)))
                ((= (x) 10) (jvm if_acmpne 14))
                ((= (x) 11) (jvm aload 0))
                ((= (x) 12) (jvm getfield src (COS_JRoom)))
                ((= (x) 13) (jvm areturn))
                ((= (x) 14) (jvm aconst_null))
                ((= (x) 15) (jvm areturn))
                (jvm return))
          )
        );