X Tutup
Skip to content

Commit f234baf

Browse files
committed
Cleanup code
1 parent b9f1782 commit f234baf

File tree

3 files changed

+12
-13
lines changed

3 files changed

+12
-13
lines changed

command/README.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,19 +75,18 @@ public class Wizard {
7575
Next 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;

command/etc/command.png

48.4 KB
Loading

command/etc/command.urm.puml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff 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
7777
InvisibilitySpell --> "-target" Target
7878
ShrinkSpell --> "-target" Target
7979
Target --> "-visibility" Visibility
80-
Goblin --|> Target
81-
InvisibilitySpell --|> Command
82-
ShrinkSpell --|> Command
83-
@enduml
80+
Goblin --|> Target
81+
InvisibilitySpell ..|> Command
82+
ShrinkSpell ..|> Command
83+
@enduml

0 commit comments

Comments
 (0)
X Tutup