Reformat rest of the design patterns - Issue #224
This commit is contained in:
@@ -2,23 +2,24 @@ package com.iluwatar.templatemethod;
|
||||
|
||||
/**
|
||||
*
|
||||
* Template Method defines a skeleton for an algorithm. The algorithm subclasses
|
||||
* provide implementation for the blank parts.
|
||||
* 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}.
|
||||
* 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();
|
||||
}
|
||||
/**
|
||||
* 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();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user