Module: HelloJavaLib
- Defined in:
- lib/hellojava.rb
Overview
jrubyからjavaの呼び出し
Defined Under Namespace
Classes: FuncTypes
Class Method Summary collapse
-
.func_a ⇒ void
Systemクラス使用.
-
.func_b ⇒ void
標準クラス以外の使用.
-
.func_c(value1, value2) ⇒ void
戻り値がオブジェクトの場合.
-
.func_d(fname, vals) ⇒ void
引数に二次元配列の場合.
Class Method Details
.func_a ⇒ void
Systemクラス使用
16 17 18 |
# File 'lib/hellojava.rb', line 16 def func_a() System.out.println("Hello, JRuby") end |
.func_b ⇒ void
標準クラス以外の使用
25 26 27 28 |
# File 'lib/hellojava.rb', line 25 def func_b() p JavaCallTest.str1 return end |
.func_c(value1, value2) ⇒ void
戻り値がオブジェクトの場合
37 38 39 40 41 42 |
# File 'lib/hellojava.rb', line 37 def func_c(value1, value2) hoge = Hoge.new calc = hoge.getCalc(value1, value2) p calc.add return end |
.func_d(fname, vals) ⇒ void
引数に二次元配列の場合
61 62 63 64 65 66 |
# File 'lib/hellojava.rb', line 61 def func_d(fname, vals) JavaCallTest.sub1( fname, vals.to_java(Java::double[]) ); return end |