File tree Expand file tree Collapse file tree 3 files changed +12
-13
lines changed
Expand file tree Collapse file tree 3 files changed +12
-13
lines changed Original file line number Diff line number Diff line change @@ -75,19 +75,18 @@ public class Wizard {
7575Next we present the spell hierarchy.
7676
7777``` java
78- public abstract class Command {
78+ public interface Command {
7979
80- public abstract void execute (Target target );
80+ void execute (Target target );
8181
82- public abstract void undo ();
82+ void undo ();
8383
84- public abstract void redo ();
84+ void redo ();
8585
86- @Override
87- public abstract String toString ();
86+ String toString ();
8887}
8988
90- public class InvisibilitySpell extends Command {
89+ public class InvisibilitySpell implements Command {
9190
9291 private Target target;
9392
@@ -117,7 +116,7 @@ public class InvisibilitySpell extends Command {
117116 }
118117}
119118
120- public class ShrinkSpell extends Command {
119+ public class ShrinkSpell implements Command {
121120
122121 private Size oldSize;
123122 private Target target;
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ package com.iluwatar.command {
44 + App ()
55 + main(args : String[]) {static}
66 }
7- abstract class Command {
7+ interface Command {
88 + Command ()
99 + execute (Target ) {abstract }
1010 + redo () {abstract }
@@ -77,7 +77,7 @@ ShrinkSpell --> "-oldSize" Size
7777InvisibilitySpell --> "- target " Target
7878ShrinkSpell --> "- target " Target
7979Target --> "- visibility " Visibility
80- Goblin --|> Target
81- InvisibilitySpell -- |> Command
82- ShrinkSpell -- |> Command
83- @enduml
80+ Goblin --|> Target
81+ InvisibilitySpell .. |> Command
82+ ShrinkSpell .. |> Command
83+ @enduml
You can’t perform that action at this time.
0 commit comments