# JAVA class translation 'COS_JThing'
# Thu Jun 30 17:00:13 EDT 2005
# Produced by Fritzifier, based on JasminVisitor
# Using BCEL library to read Java bytecode
# Here is the original code:
#
# public class COS_JThing extends COS_JNamed {
# private COS_JRoom location;
# private COS_JRoom nextLocation;
#
# public void setRoom(COS_JRoom location) {
# if (this.location!=null) {
# this.location.removeThing(this);
# }
# this.location = location;
# location.addThing(this);
# this.nextLocation = location;
# }
#
# public COS_JRoom getRoom() {
# return location;
# }
#
# public void setNextRoom(COS_JRoom location) {
# nextLocation = location;
# }
#
# public void postUpdate() {
# if (nextLocation!=location) {
# setRoom(nextLocation);
# }
# }
# }
#
[hear] (class COS_JThing ()
(field super-ref (make-cell 0))
(method new (set! (super-ref) ((COS_JNamed) / this)))
(method super (? x / (get! / super-ref) / x))
(method unknown (? x / self super / x))
(field location (cell new 0))
(field nextLocation (cell new 0))
(method <init>-V
(lambda () /
let ((vars / cell new / make-hash / vector
(pair 0 (self)))
(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 return))
(jvm return))
)
(method <init> (self <init>-V))
(method setRoom-COS_JRoom-V
(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 0))
((= (x) 1) (jvm getfield location (COS_JRoom)))
((= (x) 2) (jvm ifnull 7))
((= (x) 3) (jvm aload 0))
((= (x) 4) (jvm getfield location (COS_JRoom)))
((= (x) 5) (jvm aload 0))
((= (x) 6) (jvm invokevirtual removeThing-COS_JThing-V 1 0))
((= (x) 7) (jvm aload 0))
((= (x) 8) (jvm aload 1))
((= (x) 9) (jvm putfield location (COS_JRoom)))
((= (x) 10) (jvm aload 1))
((= (x) 11) (jvm aload 0))
((= (x) 12) (jvm invokevirtual addThing-COS_JThing-V 1 0))
((= (x) 13) (jvm aload 0))
((= (x) 14) (jvm aload 1))
((= (x) 15) (jvm putfield nextLocation (COS_JRoom)))
((= (x) 16) (jvm return))
(jvm return))
)
(method setRoom (self setRoom-COS_JRoom-V))
(method getRoom-COS_JRoom
(lambda () /
let ((vars / cell new / make-hash / vector
(pair 0 (self)))
(stack / cell new / vector)) /
state-machine (vars) (stack) / ? jvm / ? x / cond
((= (x) 0) (jvm aload 0))
((= (x) 1) (jvm getfield location (COS_JRoom)))
((= (x) 2) (jvm areturn))
(jvm return))
)
(method getRoom (self getRoom-COS_JRoom))
(method setNextRoom-COS_JRoom-V
(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 0))
((= (x) 1) (jvm aload 1))
((= (x) 2) (jvm putfield nextLocation (COS_JRoom)))
((= (x) 3) (jvm return))
(jvm return))
)
(method setNextRoom (self setNextRoom-COS_JRoom-V))
(method postUpdate-V
(lambda () /
let ((vars / cell new / make-hash / vector
(pair 0 (self)))
(stack / cell new / vector)) /
state-machine (vars) (stack) / ? jvm / ? x / cond
((= (x) 0) (jvm aload 0))
((= (x) 1) (jvm getfield nextLocation (COS_JRoom)))
((= (x) 2) (jvm aload 0))
((= (x) 3) (jvm getfield location (COS_JRoom)))
((= (x) 4) (jvm if_acmpeq 9))
((= (x) 5) (jvm aload 0))
((= (x) 6) (jvm aload 0))
((= (x) 7) (jvm getfield nextLocation (COS_JRoom)))
((= (x) 8) (jvm invokevirtual setRoom-COS_JRoom-V 1 0))
((= (x) 9) (jvm return))
(jvm return))
)
(method postUpdate (self postUpdate-V))
);