Just formatting App classes to be like the other class files on the project

This commit is contained in:
Matthew
2014-10-07 16:23:37 +01:00
parent 52f0923df9
commit bde5b343d0
24 changed files with 466 additions and 508 deletions

View File

@ -1,42 +1,41 @@
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.
*
* 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 )
{
TreasureChest chest = new TreasureChest();
ItemIterator ringIterator = chest.Iterator(ItemType.RING);
while (ringIterator.hasNext()) {
System.out.println(ringIterator.next());
}
System.out.println("----------");
ItemIterator potionIterator = chest.Iterator(ItemType.POTION);
while (potionIterator.hasNext()) {
System.out.println(potionIterator.next());
}
System.out.println("----------");
ItemIterator weaponIterator = chest.Iterator(ItemType.WEAPON);
while (weaponIterator.hasNext()) {
System.out.println(weaponIterator.next());
}
System.out.println("----------");
ItemIterator it = chest.Iterator(ItemType.ANY);
while (it.hasNext()) {
System.out.println(it.next());
}
public class App {
public static void main(String[] args) {
TreasureChest chest = new TreasureChest();
ItemIterator ringIterator = chest.Iterator(ItemType.RING);
while (ringIterator.hasNext()) {
System.out.println(ringIterator.next());
}
System.out.println("----------");
ItemIterator potionIterator = chest.Iterator(ItemType.POTION);
while (potionIterator.hasNext()) {
System.out.println(potionIterator.next());
}
System.out.println("----------");
ItemIterator weaponIterator = chest.Iterator(ItemType.WEAPON);
while (weaponIterator.hasNext()) {
System.out.println(weaponIterator.next());
}
System.out.println("----------");
ItemIterator it = chest.Iterator(ItemType.ANY);
while (it.hasNext()) {
System.out.println(it.next());
}
}
}