Skip to content

Commit f20326f

Browse files
committed
replace with English javadoc
1 parent 3eed6db commit f20326f

17 files changed

+373
-341
lines changed

src/main/java/org/codelibs/core/misc/AssertionUtil.java

+75-75
Large diffs are not rendered by default.

src/main/java/org/codelibs/core/misc/Base64Util.java

+7-7
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import org.codelibs.core.lang.StringUtil;
2020

2121
/**
22-
* Base64を扱うためのユーティリティクラスです。
22+
* Utility class for handling Base64 encoding and decoding.
2323
*
2424
* @author higa
2525
*/
@@ -42,11 +42,11 @@ public abstract class Base64Util {
4242
}
4343

4444
/**
45-
* Base64でエンコードします。
45+
* Encodes data in Base64.
4646
*
4747
* @param inData
48-
* エンコードするデータ
49-
* @return エンコードされたデータ
48+
* The data to encode
49+
* @return The encoded data
5050
*/
5151
public static String encode(final byte[] inData) {
5252
if (ArrayUtil.isEmpty(inData)) {
@@ -72,11 +72,11 @@ public static String encode(final byte[] inData) {
7272
}
7373

7474
/**
75-
* Base64でエンコードされたデータをデコードします。
75+
* Decodes data encoded in Base64.
7676
*
7777
* @param inData
78-
* デコードするデータ
79-
* @return デコードされたデータ
78+
* The data to decode
79+
* @return The decoded data
8080
*/
8181
public static byte[] decode(final String inData) {
8282
if (StringUtil.isEmpty(inData)) {

src/main/java/org/codelibs/core/misc/Disposable.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,18 @@
1616
package org.codelibs.core.misc;
1717

1818
/**
19-
* 破棄可能なリソースを表現します。
19+
* Represents a disposable resource.
2020
* <p>
21-
* S2コンテナの終了時に破棄しなければならないリソースがある場合は、 このインタフェースを実装したクラスを作成し、
22-
* {@link DisposableUtil}に登録します。
21+
* If there are resources that must be disposed of when the S2 container shuts down,
22+
* create a class that implements this interface and register it with {@link DisposableUtil}.
2323
* </p>
2424
*
2525
* @author koichik
2626
*/
2727
public interface Disposable {
2828

2929
/**
30-
* このオブジェクトが保持しているリソースを破棄します。
30+
* Disposes of the resources held by this object.
3131
*
3232
*/
3333
void dispose();

src/main/java/org/codelibs/core/misc/DisposableUtil.java

+12-12
Original file line numberDiff line numberDiff line change
@@ -22,57 +22,57 @@
2222
import java.util.Deque;
2323

2424
/**
25-
* アプリケーションの終了時にリソースを破棄するためのユーティリティクラスです。
25+
* Utility class for disposing of resources at the end of an application.
2626
* <p>
27-
* アプリケーションの終了時に破棄しなければならないリソースがある場合は、 {@link Disposable}を実装したクラスを作成し、
28-
* このクラスに登録します。
27+
* If there are resources that must be disposed of at the end of the application,
28+
* create a class that implements {@link Disposable} and register it with this class.
2929
* </p>
3030
*
3131
* @author koichik
3232
*/
3333
public abstract class DisposableUtil {
3434

35-
/** 登録済みの{@link Disposable} */
35+
/** Registered {@link Disposable} */
3636
protected static final Deque<Disposable> disposables = newLinkedList();
3737

3838
/**
39-
* 破棄可能なリソースを登録します。
39+
* Registers a disposable resource.
4040
*
4141
* @param disposable
42-
* 破棄可能なリソース。{@literal null}であってはいけません
42+
* A disposable resource. Must not be {@literal null}.
4343
*/
4444
public static synchronized void add(final Disposable disposable) {
4545
assertArgumentNotNull("disposable", disposable);
4646
disposables.addLast(disposable);
4747
}
4848

4949
/**
50-
* 破棄可能なリソースを先頭に登録します。
50+
* Registers a disposable resource at the beginning.
5151
* <p>
52-
* リソースは登録された逆順に破棄されるため、先頭に登録されたリソースは最後に破棄されることになります。
52+
* Resources are disposed of in the reverse order of their registration, so resources registered at the beginning will be disposed of last.
5353
* </p>
5454
*
5555
* @param disposable
56-
* 破棄可能なリソース。{@literal null}であってはいけません
56+
* A disposable resource. Must not be {@literal null}.
5757
*/
5858
public static synchronized void addFirst(final Disposable disposable) {
5959
assertArgumentNotNull("disposable", disposable);
6060
disposables.addFirst(disposable);
6161
}
6262

6363
/**
64-
* 破棄可能なリソースを登録解除します。
64+
* Unregisters a disposable resource.
6565
*
6666
* @param disposable
67-
* 破棄可能なリソース。{@literal null}であってはいけません
67+
* A disposable resource. Must not be {@literal null}.
6868
*/
6969
public static synchronized void remove(final Disposable disposable) {
7070
assertArgumentNotNull("disposable", disposable);
7171
disposables.remove(disposable);
7272
}
7373

7474
/**
75-
* 登録済みのリソースを全て破棄します。
75+
* Disposes of all registered resources.
7676
*/
7777
public static synchronized void dispose() {
7878
while (!disposables.isEmpty()) {

src/main/java/org/codelibs/core/misc/DynamicProperties.java

+33
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,39 @@
3636
import org.codelibs.core.exception.FileAccessException;
3737
import org.codelibs.core.exception.IORuntimeException;
3838

39+
/**
40+
* The {@code DynamicProperties} class extends {@link Properties} to provide dynamic
41+
* loading and storing of properties from a file. It monitors the file for changes
42+
* and reloads the properties if the file is updated. This class is thread-safe and
43+
* ensures that the properties are always up-to-date.
44+
*
45+
* <p>Key Features:
46+
* <ul>
47+
* <li>Automatically reloads properties if the file is modified.</li>
48+
* <li>Supports custom check intervals for file modification checks.</li>
49+
* <li>Provides synchronized methods for loading and storing properties.</li>
50+
* <li>Extends {@link Properties} and overrides its methods to work with dynamic properties.</li>
51+
* </ul>
52+
*
53+
* <p>Usage:
54+
* <pre>
55+
* DynamicProperties dynamicProperties = new DynamicProperties("path/to/properties/file");
56+
* String value = dynamicProperties.getProperty("key");
57+
* dynamicProperties.setProperty("key", "newValue");
58+
* dynamicProperties.store();
59+
* </pre>
60+
*
61+
* <p>Exceptions:
62+
* <ul>
63+
* <li>{@link FileAccessException} - Thrown if there are issues accessing the file.</li>
64+
* <li>{@link IORuntimeException} - Thrown if there are I/O errors during file operations.</li>
65+
* </ul>
66+
*
67+
* <p>Thread Safety:
68+
* This class uses synchronization to ensure thread-safe access to the properties.
69+
*
70+
* @see Properties
71+
*/
3972
public class DynamicProperties extends Properties {
4073

4174
private static final long serialVersionUID = 1L;

src/main/java/org/codelibs/core/misc/LocaleUtil.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,17 @@
1919
import java.util.function.Supplier;
2020

2121
/**
22-
* {@link Locale}用のユーティリティクラスです。
22+
* Utility class for {@link Locale}.
2323
*
2424
* @author higa
2525
*/
2626
public abstract class LocaleUtil {
2727

2828
/**
29-
* {@link Locale}を返します。
29+
* Returns a {@link Locale}.
3030
*
3131
* @param localeStr
32-
* ロケールを表す文字列
32+
* A string representing the locale
3333
* @return {@link Locale}
3434
*/
3535
public static Locale getLocale(final String localeStr) {

src/main/java/org/codelibs/core/misc/Pair.java

+23-23
Original file line numberDiff line numberDiff line change
@@ -16,91 +16,91 @@
1616
package org.codelibs.core.misc;
1717

1818
/**
19-
* 二つの値のペアです。
19+
* A pair of two values.
2020
*
2121
* @author koichik
2222
* @param <T1>
23-
* 1番目の値の型
23+
* The type of the first value
2424
* @param <T2>
25-
* 2番目の値の型
25+
* The type of the second value
2626
*/
2727
public class Pair<T1, T2> {
2828

29-
/** 1番目の値 */
29+
/** The first value */
3030
protected T1 first;
3131

32-
/** 2番目の値 */
32+
/** The second value */
3333
protected T2 second;
3434

3535
/**
36-
* 二つの値のペアを作成して返します。
36+
* Creates and returns a pair of two values.
3737
*
3838
* @param <T1>
39-
* 1番目の値の型
39+
* The type of the first value
4040
* @param <T2>
41-
* 2番目の値の型
41+
* The type of the second value
4242
* @param first
43-
* 1番目の値
43+
* The first value
4444
* @param second
45-
* 2番目の値
46-
* @return 二つの値のペア
45+
* The second value
46+
* @return A pair of two values
4747
*/
4848
public static <T1, T2> Pair<T1, T2> pair(final T1 first, final T2 second) {
4949
return new Pair<>(first, second);
5050
}
5151

5252
/**
53-
* インスタンスを構築します。
53+
* Constructs an instance.
5454
*/
5555
public Pair() {
5656
}
5757

5858
/**
59-
* インスタンスを構築します。
59+
* Constructs an instance.
6060
*
6161
* @param first
62-
* 1番目の値
62+
* The first value
6363
* @param second
64-
* 2番目の値
64+
* The second value
6565
*/
6666
public Pair(final T1 first, final T2 second) {
6767
this.first = first;
6868
this.second = second;
6969
}
7070

7171
/**
72-
* 1番目の値を返します。
72+
* Returns the first value.
7373
*
74-
* @return 1番目の値
74+
* @return The first value
7575
*/
7676
public T1 getFirst() {
7777
return first;
7878
}
7979

8080
/**
81-
* 1番目の値を設定します。
81+
* Sets the first value.
8282
*
8383
* @param first
84-
* 1番目の値
84+
* The first value
8585
*/
8686
public void setFirst(final T1 first) {
8787
this.first = first;
8888
}
8989

9090
/**
91-
* 2番目の値を返します。
91+
* Returns the second value.
9292
*
93-
* @return 2番目の値
93+
* @return The second value
9494
*/
9595
public T2 getSecond() {
9696
return second;
9797
}
9898

9999
/**
100-
* 2番目の値を設定します。
100+
* Sets the second value.
101101
*
102102
* @param second
103-
* 2番目の値
103+
* The second value
104104
*/
105105
public void setSecond(final T2 second) {
106106
this.second = second;

0 commit comments

Comments
 (0)