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,17 +1,17 @@
package com.iluwatar;
/**
*
*
* Template Method (StealingMethod) defines skeleton for the algorithm and
* subclasses (HitAndRunMethod, SubtleMethod) fill in the blanks.
*
*
*/
public class App {
public static void main(String[] args) {
HalflingThief thief = new HalflingThief(new HitAndRunMethod());
thief.steal();
thief.changeMethod(new SubtleMethod());
thief.steal();
}
public static void main(String[] args) {
HalflingThief thief = new HalflingThief(new HitAndRunMethod());
thief.steal();
thief.changeMethod(new SubtleMethod());
thief.steal();
}
}

View File

@ -3,7 +3,7 @@ package com.iluwatar;
/**
*
* Halfling thief uses StealingMethod to steal.
*
*
*/
public class HalflingThief {
@ -12,11 +12,11 @@ public class HalflingThief {
public HalflingThief(StealingMethod method) {
this.method = method;
}
public void steal() {
method.steal();
}
public void changeMethod(StealingMethod method) {
this.method = method;
}

View File

@ -3,14 +3,14 @@ package com.iluwatar;
/**
*
* Template Method base class.
*
*
*/
public abstract class StealingMethod {
protected abstract String pickTarget();
protected abstract void confuseTarget(String target);
protected abstract void stealTheItem(String target);
public void steal() {

View File

@ -9,12 +9,14 @@ public class SubtleMethod extends StealingMethod {
@Override
protected void confuseTarget(String target) {
System.out.println("Approach the " + target + " with tears running and hug him!");
System.out.println("Approach the " + target
+ " with tears running and hug him!");
}
@Override
protected void stealTheItem(String target) {
System.out.println("While in close contact grab the " + target + "'s wallet.");
System.out.println("While in close contact grab the " + target
+ "'s wallet.");
}
}