Added comments for iterator example.

This commit is contained in:
Ilkka Seppala 2014-08-31 11:03:43 +03:00
parent 4fef18f6c6
commit 40e5444718
3 changed files with 17 additions and 0 deletions

View File

@ -1,5 +1,12 @@
package com.iluwatar;
/**
*
* Iterator (ItemIterator) adds abstraction layer on top of a
* collection (TreasureChest). This way the collection can change
* its internal implementation without affecting its clients.
*
*/
public class App
{
public static void main( String[] args )

View File

@ -1,5 +1,10 @@
package com.iluwatar;
/**
*
* Iterator interface.
*
*/
public interface ItemIterator {
boolean hasNext();

View File

@ -3,6 +3,11 @@ package com.iluwatar;
import java.util.ArrayList;
import java.util.List;
/**
*
* Collection class.
*
*/
public class TreasureChest {
private List<Item> items;