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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d0c2ffdb6d2410fbf8dd873ed900d3fc7039fe7b8b049311a2b534e6fa485ed2
4
- data.tar.gz: 9123d1fd37b94823905cf7bd1c3f48202e57b64a984c7801e8f0043882b87a60
3
+ metadata.gz: 1cffd381d1e1109af675b8cb94187962e67b6dbf3ea6042eb97b5a9f073eb3ec
4
+ data.tar.gz: 46b0dd75a091b2102b8749a13b9875d9cc6ca0dbb5de8e8a29c14d9c983bff75
5
5
  SHA512:
6
- metadata.gz: 1d5d2c1a4cfdcdc7f9204700b7665b637e19f147b37407b76d156840e102289eb4edd3166eefc24f8277380f44d068f02a42c7a90b025a1552dcf8b1b7e624e6
7
- data.tar.gz: 0f02ff2814a869a34f0c936fc7ba54a4cf84014f917198b8dc8395587ef19256b4831738b4b0b577070ea099d5c9b27013ef0723eff28563e4a071a3f896f615
6
+ metadata.gz: 38a4c1b06b61727bd80a75ef5304acbc07f3fd97f3cfd3ab18172e8d7386fe56d44e919dd0b02e25eac5525a600bf0f4ee39db60fbb406b0f72b55798c0edd63
7
+ data.tar.gz: 564535daf02d2b576adcd9a7af2baa000d0226b2ac1368bc2676a799bb8e07271e1a047c7d5e53c87d0cca1ff7dc0f12a9cebaa1ee4a22378d7dbe34f96abb22
data/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## [0.0.3] - 2023-10-21
6
+
7
+ ### Added
8
+ - Add test parameter of A two-dimensional array
9
+
5
10
  ## [0.0.2] - 2023-09-27
6
11
 
7
12
  ### Added
@@ -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.2
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-09-27 00:00:00.000000000 Z
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