Skip to content

Commit 86c68f9

Browse files
committed
iluwatar#107 Improve JavaDoc for Object Pool example
1 parent 2bc2384 commit 86c68f9

File tree

2 files changed

+12
-3
lines changed
  • object-pool/src

2 files changed

+12
-3
lines changed

object-pool/src/main/java/com/iluwatar/object/pool/App.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,25 @@
55
* When it is necessary to work with a large number of objects that are particularly expensive to instantiate
66
* and each object is only needed for a short period of time, the performance of an entire application may be
77
* adversely affected. An object pool design pattern may be deemed desirable in cases such as these.
8-
*
8+
* <p>
99
* The object pool design pattern creates a set of objects that may be reused. When a new object is needed, it
1010
* is requested from the pool. If a previously prepared object is available it is returned immediately, avoiding
1111
* the instantiation cost. If no objects are present in the pool, a new item is created and returned. When the
1212
* object has been used and is no longer needed, it is returned to the pool, allowing it to be used again in the
1313
* future without repeating the computationally expensive instantiation process. It is important to note that
1414
* once an object has been used and returned, existing references will become invalid.
15-
*
16-
* In this example we have created OliphauntPool inheriting from generic ObjectPool. Oliphaunts can be checked
15+
* <p>
16+
* In this example we have created {@link OliphauntPool} inheriting from generic {@link ObjectPool}. {@link Oliphaunt}s can be checked
1717
* out from the pool and later returned to it. The pool tracks created instances and their status (available,
1818
* inUse).
1919
*
2020
*/
2121
public class App {
2222

23+
/**
24+
* Program entry point
25+
* @param args command line args
26+
*/
2327
public static void main( String[] args ) {
2428
OliphauntPool pool = new OliphauntPool();
2529
System.out.println(pool);

object-pool/src/test/java/com/iluwatar/object/pool/AppTest.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44

55
import com.iluwatar.object.pool.App;
66

7+
/**
8+
*
9+
* Application test
10+
*
11+
*/
712
public class AppTest {
813

914
@Test

0 commit comments

Comments
 (0)