Improved code comments for template method example.
This commit is contained in:
parent
991653062d
commit
b12243b94c
@ -2,8 +2,11 @@ package com.iluwatar;
|
||||
|
||||
/**
|
||||
*
|
||||
* Template Method (StealingMethod) defines skeleton for the algorithm and
|
||||
* subclasses (HitAndRunMethod, SubtleMethod) fill in the blanks.
|
||||
* 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 {
|
||||
|
@ -1,5 +1,10 @@
|
||||
package com.iluwatar;
|
||||
|
||||
/**
|
||||
*
|
||||
* HitAndRunMethod implementation of StealingMethod.
|
||||
*
|
||||
*/
|
||||
public class HitAndRunMethod extends StealingMethod {
|
||||
|
||||
@Override
|
||||
|
@ -2,7 +2,7 @@ package com.iluwatar;
|
||||
|
||||
/**
|
||||
*
|
||||
* Template Method base class.
|
||||
* StealingMethod defines skeleton for the algorithm.
|
||||
*
|
||||
*/
|
||||
public abstract class StealingMethod {
|
||||
|
@ -1,5 +1,10 @@
|
||||
package com.iluwatar;
|
||||
|
||||
/**
|
||||
*
|
||||
* SubtleMethod implementation of StealingMethod.
|
||||
*
|
||||
*/
|
||||
public class SubtleMethod extends StealingMethod {
|
||||
|
||||
@Override
|
||||
|
Loading…
x
Reference in New Issue
Block a user