#107 Template Method JavaDoc

This commit is contained in:
Ilkka Seppala
2015-08-21 23:19:55 +03:00
parent 934f99e2a9
commit fde7f71704
5 changed files with 118 additions and 109 deletions

View File

@@ -1,23 +1,23 @@
package com.iluwatar.templatemethod;
/**
*
* Halfling thief uses StealingMethod to steal.
*
*/
public class HalflingThief {
private StealingMethod method;
public HalflingThief(StealingMethod method) {
this.method = method;
}
public void steal() {
method.steal();
}
public void changeMethod(StealingMethod method) {
this.method = method;
}
}
package com.iluwatar.templatemethod;
/**
*
* Halfling thief uses {@link StealingMethod} to steal.
*
*/
public class HalflingThief {
private StealingMethod method;
public HalflingThief(StealingMethod method) {
this.method = method;
}
public void steal() {
method.steal();
}
public void changeMethod(StealingMethod method) {
this.method = method;
}
}