*** empty log message ***
authorcg
Wed, 06 Aug 1997 00:52:47 +0000
changeset 202 59b27ac31896
parent 201 912c48b6e7ac
child 203 67af98594672
*** empty log message ***
JavaObject.st
--- a/JavaObject.st	Tue Aug 05 22:59:16 1997 +0000
+++ b/JavaObject.st	Wed Aug 06 00:52:47 1997 +0000
@@ -458,6 +458,36 @@
     "Created: 30.7.1997 / 13:36:02 / cg"
 !
 
+invokeJavaMethod:aJavaMethod interpreter:i sender:s selector:sel with:arg1 with:arg2 with:arg3 with:arg4
+    "invoke a java method, with 4 arguments.
+     CAVEAT: these cannot be long or doubles currently."
+
+    |val|
+
+    aJavaMethod numArgs ~~ 4 ifTrue:[
+        self halt:'argument count'
+    ].
+    aJavaMethod isStatic ifTrue:[
+        self halt:'static function'
+    ].
+
+    val := aJavaMethod valueWithReceiver:self arguments:(Array with:arg1 with:arg2 with:arg3 with:arg4) selector:sel.
+    val notNil ifTrue:[^ val].
+
+    i push:self.
+    i push:arg1.
+    i push:arg2.
+    i push:arg3.
+    i push:arg4.
+
+    val := i interpret:aJavaMethod sender:s.
+
+    ^ JavaObject convertJavaObject:val signature:(aJavaMethod retValSignature)
+
+    "Modified: 30.7.1997 / 13:20:35 / cg"
+    "Created: 6.8.1997 / 02:41:32 / cg"
+!
+
 invokeJavaMethod:aJavaMethod interpreter:i sender:s selector:sel with:arg1 with:arg2 with:arg3 with:arg4 with:arg5
     "invoke a java method, with 5 arguments.
      CAVEAT: these cannot be long or doubles currently."
@@ -758,6 +788,23 @@
     "Created: 30.7.1997 / 13:48:24 / cg"
 !
 
+invoke:selector with:arg1 with:arg2 with:arg3 with:arg4
+    "send a message, with 5 argument. 
+     TEMPORARY: This method needs more work."
+
+    ^ self 
+        invoke:selector 
+        interpreter:JavaInterpreter new 
+        sender:thisContext sender 
+        with:arg1
+        with:arg2
+        with:arg3
+        with:arg4
+
+    "Modified: 30.7.1997 / 13:44:58 / cg"
+    "Created: 6.8.1997 / 02:38:44 / cg"
+!
+
 invoke:selector with:arg1 with:arg2 with:arg3 with:arg4 with:arg5
     "send a message, with 5 argument. 
      TEMPORARY: This method needs more work."
@@ -848,5 +895,5 @@
 !JavaObject class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /home/jv/Projects/SmalltalkX/repositories/cvs/stx/libjava/JavaObject.st,v 1.30 1997/08/05 15:03:28 cg Exp $'
+    ^ '$Header: /home/jv/Projects/SmalltalkX/repositories/cvs/stx/libjava/JavaObject.st,v 1.31 1997/08/06 00:52:47 cg Exp $'
 ! !