X Tutup
Skip to content

Commit 40e5444

Browse files
committed
Added comments for iterator example.
1 parent 4fef18f commit 40e5444

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

iterator/src/main/java/com/iluwatar/App.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
package com.iluwatar;
22

3+
/**
4+
*
5+
* Iterator (ItemIterator) adds abstraction layer on top of a
6+
* collection (TreasureChest). This way the collection can change
7+
* its internal implementation without affecting its clients.
8+
*
9+
*/
310
public class App
411
{
512
public static void main( String[] args )

iterator/src/main/java/com/iluwatar/ItemIterator.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
package com.iluwatar;
22

3+
/**
4+
*
5+
* Iterator interface.
6+
*
7+
*/
38
public interface ItemIterator {
49

510
boolean hasNext();

iterator/src/main/java/com/iluwatar/TreasureChest.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
import java.util.ArrayList;
44
import java.util.List;
55

6+
/**
7+
*
8+
* Collection class.
9+
*
10+
*/
611
public class TreasureChest {
712

813
private List<Item> items;

0 commit comments

Comments
 (0)
X Tutup