JavaObject.st
author cg
Tue, 30 Apr 1996 23:23:46 +0000
changeset 26 a08fff66123e
child 29 eb3367f8fb9b
permissions -rw-r--r--
intitial checkin
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
26
a08fff66123e intitial checkin
cg
parents:
diff changeset
     1
Object subclass:#JavaObject
a08fff66123e intitial checkin
cg
parents:
diff changeset
     2
	instanceVariableNames:''
a08fff66123e intitial checkin
cg
parents:
diff changeset
     3
	classVariableNames:''
a08fff66123e intitial checkin
cg
parents:
diff changeset
     4
	poolDictionaries:''
a08fff66123e intitial checkin
cg
parents:
diff changeset
     5
	category:'Java-Classes'
a08fff66123e intitial checkin
cg
parents:
diff changeset
     6
!
a08fff66123e intitial checkin
cg
parents:
diff changeset
     7
a08fff66123e intitial checkin
cg
parents:
diff changeset
     8
a08fff66123e intitial checkin
cg
parents:
diff changeset
     9
!JavaObject methodsFor:'message sending'!
a08fff66123e intitial checkin
cg
parents:
diff changeset
    10
a08fff66123e intitial checkin
cg
parents:
diff changeset
    11
invoke:selector
a08fff66123e intitial checkin
cg
parents:
diff changeset
    12
    "/ invoke selector, without arguments
a08fff66123e intitial checkin
cg
parents:
diff changeset
    13
a08fff66123e intitial checkin
cg
parents:
diff changeset
    14
    |method cls i|
a08fff66123e intitial checkin
cg
parents:
diff changeset
    15
a08fff66123e intitial checkin
cg
parents:
diff changeset
    16
    cls := self class.
a08fff66123e intitial checkin
cg
parents:
diff changeset
    17
    [method isNil] whileTrue:[
a08fff66123e intitial checkin
cg
parents:
diff changeset
    18
        method := cls compiledMethodAt:selector.
a08fff66123e intitial checkin
cg
parents:
diff changeset
    19
        cls := cls superclass.
a08fff66123e intitial checkin
cg
parents:
diff changeset
    20
        cls isNil ifTrue:[
a08fff66123e intitial checkin
cg
parents:
diff changeset
    21
            self doesNotUnderstand:(Message selector:selector)
a08fff66123e intitial checkin
cg
parents:
diff changeset
    22
        ]
a08fff66123e intitial checkin
cg
parents:
diff changeset
    23
    ].
a08fff66123e intitial checkin
cg
parents:
diff changeset
    24
    i := JavaInterpreter new.
a08fff66123e intitial checkin
cg
parents:
diff changeset
    25
    i push:self.
a08fff66123e intitial checkin
cg
parents:
diff changeset
    26
    ^ i interpret:method
a08fff66123e intitial checkin
cg
parents:
diff changeset
    27
! !
a08fff66123e intitial checkin
cg
parents:
diff changeset
    28
a08fff66123e intitial checkin
cg
parents:
diff changeset
    29
!JavaObject class methodsFor:'documentation'!
a08fff66123e intitial checkin
cg
parents:
diff changeset
    30
a08fff66123e intitial checkin
cg
parents:
diff changeset
    31
version
a08fff66123e intitial checkin
cg
parents:
diff changeset
    32
    ^ '$Header: /home/jv/Projects/SmalltalkX/repositories/cvs/stx/libjava/JavaObject.st,v 1.1 1996/04/30 23:23:46 cg Exp $'
a08fff66123e intitial checkin
cg
parents:
diff changeset
    33
! !