hellojava 0.0.2-java → 0.0.3-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/ext/hellojava/JavaCallTest.java +12 -0
- data/lib/hellojava.rb +25 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1cffd381d1e1109af675b8cb94187962e67b6dbf3ea6042eb97b5a9f073eb3ec
|
4
|
+
data.tar.gz: 46b0dd75a091b2102b8749a13b9875d9cc6ca0dbb5de8e8a29c14d9c983bff75
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 38a4c1b06b61727bd80a75ef5304acbc07f3fd97f3cfd3ab18172e8d7386fe56d44e919dd0b02e25eac5525a600bf0f4ee39db60fbb406b0f72b55798c0edd63
|
7
|
+
data.tar.gz: 564535daf02d2b576adcd9a7af2baa000d0226b2ac1368bc2676a799bb8e07271e1a047c7d5e53c87d0cca1ff7dc0f12a9cebaa1ee4a22378d7dbe34f96abb22
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
import java.util.ArrayList;
|
2
|
+
|
1
3
|
public class JavaCallTest {
|
2
4
|
public static String str1() {
|
3
5
|
return "str1";
|
@@ -5,5 +7,15 @@ public class JavaCallTest {
|
|
5
7
|
public String str2() {
|
6
8
|
return "str2";
|
7
9
|
}
|
10
|
+
public static void sub1(String fname, double[][] vals) {
|
11
|
+
System.out.printf("fname:%s size:%d\n", fname, vals.length);
|
12
|
+
for (int i = 0; i < vals.length; i++) {
|
13
|
+
System.out.printf("vals[%d] size:%d\n", i, vals[i].length);
|
14
|
+
for (int j = 0; j < vals[i].length; j++) {
|
15
|
+
System.out.printf(" %f", vals[i][j]);
|
16
|
+
}
|
17
|
+
System.out.println();
|
18
|
+
}
|
19
|
+
}
|
8
20
|
}
|
9
21
|
|
data/lib/hellojava.rb
CHANGED
@@ -38,10 +38,34 @@ module HelloJavaLib
|
|
38
38
|
p calc.add
|
39
39
|
return
|
40
40
|
end
|
41
|
-
|
41
|
+
# 引数に二次元配列の場合
|
42
|
+
#
|
43
|
+
# @overload func_d(fname, vals)
|
44
|
+
# @param [String] fname 文字列
|
45
|
+
# @param [Array] vals 二次元の配列(double[][])
|
46
|
+
# @return [void]
|
47
|
+
# @example
|
48
|
+
# vals = [
|
49
|
+
# [12.3, 22.5, 33.7, 44.6],
|
50
|
+
# [12.3, 22.5, 33.7, 44.6, 55.8],
|
51
|
+
# ]
|
52
|
+
# HelloJavaLib::func_d("fname.jpg", vals)
|
53
|
+
# =>
|
54
|
+
# fname:fname.jpg size:2
|
55
|
+
# vals[0] size:4
|
56
|
+
# 12.300000 22.500000 33.700000 44.600000
|
57
|
+
# vals[1] size:5
|
58
|
+
# 12.300000 22.500000 33.700000 44.600000 55.800000
|
59
|
+
def func_d(fname, vals)
|
60
|
+
p JavaCallTest.sub1(
|
61
|
+
fname, vals.to_java(Java::double[])
|
62
|
+
);
|
63
|
+
return
|
64
|
+
end
|
42
65
|
module_function :func_a
|
43
66
|
module_function :func_b
|
44
67
|
module_function :func_c
|
68
|
+
module_function :func_d
|
45
69
|
|
46
70
|
end
|
47
71
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hellojava
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- siranovel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-10-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|