Formatted all files to the same standard

This commit is contained in:
matthew
2014-10-08 13:42:12 +01:00
parent 53a2a8b150
commit 3da9ad5469
151 changed files with 952 additions and 870 deletions

View File

@ -1,20 +1,20 @@
package com.iluwatar;
/**
*
*
* Proxy (WizardTowerProxy) controls access to the actual object (WizardTower).
*
*
*/
public class App {
public static void main(String[] args) {
public static void main(String[] args) {
WizardTowerProxy tower = new WizardTowerProxy();
tower.enter(new Wizard("Red wizard"));
tower.enter(new Wizard("White wizard"));
tower.enter(new Wizard("Black wizard"));
tower.enter(new Wizard("Green wizard"));
tower.enter(new Wizard("Brown wizard"));
WizardTowerProxy tower = new WizardTowerProxy();
tower.enter(new Wizard("Red wizard"));
tower.enter(new Wizard("White wizard"));
tower.enter(new Wizard("Black wizard"));
tower.enter(new Wizard("Green wizard"));
tower.enter(new Wizard("Brown wizard"));
}
}
}

View File

@ -12,5 +12,5 @@ public class Wizard {
public String toString() {
return name;
}
}

View File

@ -3,12 +3,12 @@ package com.iluwatar;
/**
*
* The object to be proxyed.
*
*
*/
public class WizardTower {
public void enter(Wizard wizard) {
System.out.println(wizard + " enters the tower.");
}
}

View File

@ -3,14 +3,14 @@ package com.iluwatar;
/**
*
* The proxy controlling access to WizardTower.
*
*
*/
public class WizardTowerProxy extends WizardTower {
private static final int NUM_WIZARDS_ALLOWED = 3;
private int numWizards;
@Override
public void enter(Wizard wizard) {
if (numWizards < NUM_WIZARDS_ALLOWED) {