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
template-method/src
main
test
java
com
iluwatar
templatemethod

@@ -1,20 +1,24 @@
package com.iluwatar.templatemethod;
/**
*
* Template Method defines a skeleton for an algorithm. The algorithm subclasses
* provide implementation for the blank parts.
*
* In this example HalflingThief contains StealingMethod that can be changed.
* First the thief hits with HitAndRunMethod and then with SubtleMethod.
*
*/
public class App {
public static void main(String[] args) {
HalflingThief thief = new HalflingThief(new HitAndRunMethod());
thief.steal();
thief.changeMethod(new SubtleMethod());
thief.steal();
}
}
package com.iluwatar.templatemethod;
/**
*
* Template Method defines a skeleton for an algorithm. The algorithm subclasses
* provide implementation for the blank parts.
* <p>
* In this example {@link HalflingThief} contains {@link StealingMethod} that can be changed.
* First the thief hits with {@link HitAndRunMethod} and then with {@link SubtleMethod}.
*
*/
public class App {
/**
* Program entry point
* @param args command line args
*/
public static void main(String[] args) {
HalflingThief thief = new HalflingThief(new HitAndRunMethod());
thief.steal();
thief.changeMethod(new SubtleMethod());
thief.steal();
}
}