#107 Template Method JavaDoc
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user