Skip to content

Commit 5a11413

Browse files
doc: update Javadoc for libcobj/ui (#825)
1 parent 79b9a00 commit 5a11413

6 files changed

Lines changed: 51 additions & 43 deletions

File tree

libcobj/app/src/main/java/jp/osscons/opensourcecobol/libcobj/ui/CobolCallResult.java

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,36 @@
11
package jp.osscons.opensourcecobol.libcobj.ui;
22

3-
/** TODO: 準備中 */
3+
/**
4+
* CALL文の結果を保持するための基底クラス<br>
5+
* サブクラスで保持する型に対応するgetメソッドをオーバーライドする。
6+
* 対応しない型のgetメソッドを呼び出した場合は{@link CobolResultSetException}がスローされる。
7+
*/
48
public class CobolCallResult {
59
/**
6-
* TODO: 準備中
10+
* 結果をint型として取得する。
711
*
8-
* @return TODO: 準備中
9-
* @throws CobolResultSetException TODO: 準備中
12+
* @return int型の結果値
13+
* @throws CobolResultSetException 結果の型がintでない場合
1014
*/
1115
public int getInt() throws CobolResultSetException {
1216
throw new CobolResultSetException("The result type is not 'int'");
1317
}
1418

1519
/**
16-
* TODO: 準備中
20+
* 結果をdouble型として取得する。
1721
*
18-
* @return TODO: 準備中
19-
* @throws CobolResultSetException TODO: 準備中
22+
* @return double型の結果値
23+
* @throws CobolResultSetException 結果の型がdoubleでない場合
2024
*/
2125
public double getDouble() throws CobolResultSetException {
2226
throw new CobolResultSetException("The result type is not 'double'");
2327
}
2428

2529
/**
26-
* TODO: 準備中
30+
* 結果をString型として取得する。
2731
*
28-
* @return TODO: 準備中
29-
* @throws CobolResultSetException TODO: 準備中
32+
* @return String型の結果値
33+
* @throws CobolResultSetException 結果の型がStringでない場合
3034
*/
3135
public String getString() throws CobolResultSetException {
3236
throw new CobolResultSetException("The result type is not 'String'");

libcobj/app/src/main/java/jp/osscons/opensourcecobol/libcobj/ui/CobolResultDouble.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
package jp.osscons.opensourcecobol.libcobj.ui;
22

3-
/** TODO: 準備中 */
3+
/** double型のCALL文の結果を保持する{@link CobolCallResult}のサブクラス */
44
public class CobolResultDouble extends CobolCallResult {
55
private double value;
66

77
/**
8-
* TODO: 準備中
8+
* 指定されたdouble値を保持するCobolResultDoubleを生成する。
99
*
10-
* @param d TODO: 準備中
10+
* @param d 保持するdouble値
1111
*/
1212
public CobolResultDouble(double d) {
1313
this.value = d;
1414
}
1515

16-
/** TODO: 準備中 */
16+
/** {@inheritDoc} */
1717
@Override
1818
public double getDouble() throws CobolResultSetException {
1919
return this.value;

libcobj/app/src/main/java/jp/osscons/opensourcecobol/libcobj/ui/CobolResultInt.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
package jp.osscons.opensourcecobol.libcobj.ui;
22

3-
/** TODO: 準備中 */
3+
/** int型のCALL文の結果を保持する{@link CobolCallResult}のサブクラス */
44
public class CobolResultInt extends CobolCallResult {
55
private int value;
66

77
/**
8-
* TODO: 準備中
8+
* 指定されたint値を保持するCobolResultIntを生成する。
99
*
10-
* @param i TODO: 準備中
10+
* @param i 保持するint値
1111
*/
1212
public CobolResultInt(int i) {
1313
this.value = i;
1414
}
1515

16-
/** TODO: 準備中 */
16+
/** {@inheritDoc} */
1717
@Override
1818
public int getInt() throws CobolResultSetException {
1919
return this.value;

libcobj/app/src/main/java/jp/osscons/opensourcecobol/libcobj/ui/CobolResultSet.java

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
package jp.osscons.opensourcecobol.libcobj.ui;
22

3-
/** TODO: 準備中 */
3+
/**
4+
* CALL文の実行結果をまとめて保持するクラス<br>
5+
* リターンコードと複数の{@link CobolCallResult}を保持し、インデックス指定で各結果にアクセスできる。
6+
* インデックスは1始まりで指定する。
7+
*/
48
public class CobolResultSet {
59
private CobolCallResult results[];
610
private int returnCode;
711

812
/**
9-
* TODO: 準備中
13+
* 指定されたリターンコードと結果の配列を持つCobolResultSetを生成する。
1014
*
11-
* @param returnCode TODO: 準備中
12-
* @param results TODO: 準備中
15+
* @param returnCode CALL文のリターンコード
16+
* @param results CALL文の結果の配列
1317
*/
1418
public CobolResultSet(int returnCode, CobolCallResult... results) {
1519
this.returnCode = returnCode;
@@ -23,44 +27,44 @@ private void checkIndexInValidRange(int index) throws CobolResultSetException {
2327
}
2428

2529
/**
26-
* TODO: 準備中
30+
* CALL文のリターンコードを取得する。
2731
*
28-
* @return TODO: 準備中
32+
* @return リターンコード
2933
*/
3034
public int getReturnCode() {
3135
return this.returnCode;
3236
}
3337

3438
/**
35-
* TODO: 準備中
39+
* 指定されたインデックスの結果をString型として取得する。
3640
*
37-
* @param index TODO: 準備中
38-
* @return TODO: 準備中
39-
* @throws CobolResultSetException TODO: 準備中
41+
* @param index 結果のインデックス(1始まり)
42+
* @return String型の結果値
43+
* @throws CobolResultSetException インデックスが範囲外の場合、または結果の型がStringでない場合
4044
*/
4145
public String getString(int index) throws CobolResultSetException {
4246
this.checkIndexInValidRange(index);
4347
return this.results[index - 1].getString();
4448
}
4549

4650
/**
47-
* TODO: 準備中
51+
* 指定されたインデックスの結果をint型として取得する。
4852
*
49-
* @param index TODO: 準備中
50-
* @return TODO: 準備中
51-
* @throws CobolResultSetException TODO: 準備中
53+
* @param index 結果のインデックス(1始まり)
54+
* @return int型の結果値
55+
* @throws CobolResultSetException インデックスが範囲外の場合、または結果の型がintでない場合
5256
*/
5357
public int getInt(int index) throws CobolResultSetException {
5458
this.checkIndexInValidRange(index);
5559
return this.results[index - 1].getInt();
5660
}
5761

5862
/**
59-
* TODO: 準備中
63+
* 指定されたインデックスの結果をdouble型として取得する。
6064
*
61-
* @param index TODO: 準備中
62-
* @return TODO: 準備中
63-
* @throws CobolResultSetException TODO: 準備中
65+
* @param index 結果のインデックス(1始まり)
66+
* @return double型の結果値
67+
* @throws CobolResultSetException インデックスが範囲外の場合、または結果の型がdoubleでない場合
6468
*/
6569
public double getDouble(int index) throws CobolResultSetException {
6670
this.checkIndexInValidRange(index);

libcobj/app/src/main/java/jp/osscons/opensourcecobol/libcobj/ui/CobolResultSetException.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
package jp.osscons.opensourcecobol.libcobj.ui;
22

3-
/** TODO: 準備中 */
3+
/** {@link CobolResultSet}や{@link CobolCallResult}の操作で不正なアクセスが行われた場合にスローされる例外 */
44
public class CobolResultSetException extends Exception {
55
/**
6-
* TODO: 準備中
6+
* 指定されたメッセージを持つCobolResultSetExceptionを生成する。
77
*
8-
* @param message TODO: 準備中
8+
* @param message 例外の詳細メッセージ
99
*/
1010
public CobolResultSetException(String message) {
1111
super(message);

libcobj/app/src/main/java/jp/osscons/opensourcecobol/libcobj/ui/CobolResultString.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
package jp.osscons.opensourcecobol.libcobj.ui;
22

3-
/** TODO: 準備中 */
3+
/** String型のCALL文の結果を保持する{@link CobolCallResult}のサブクラス */
44
public class CobolResultString extends CobolCallResult {
55
private String value;
66

77
/**
8-
* TODO: 準備中
8+
* 指定されたString値を保持するCobolResultStringを生成する。
99
*
10-
* @param s TODO: 準備中
10+
* @param s 保持するString値
1111
*/
1212
public CobolResultString(String s) {
1313
this.value = s;
1414
}
1515

16-
/** TODO: 準備中 */
16+
/** {@inheritDoc} */
1717
@Override
1818
public String getString() throws CobolResultSetException {
1919
return this.value;

0 commit comments

Comments
 (0)