Skip to content

Commit 93470c3

Browse files
Updated the Title for the Code Block in Command Pattern Blog.
1 parent 3b01d7c commit 93470c3

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

content/Command Pattern.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ _Design of the Remote Control_
137137

138138
First, create the `Command.java` interface. This defines what every Command must do:
139139

140-
```java
140+
```java title="Command.java"
141141
interface Command {
142142
public void execute();
143143
public void undo();
@@ -146,7 +146,7 @@ interface Command {
146146

147147
Next, make the Receiver classes. A Receiver carries out the real work.
148148

149-
```java
149+
```java title="Light.java"
150150
class Light {
151151
public void off() {
152152
System.out.println("Light is Turned Off");
@@ -158,7 +158,7 @@ class Light {
158158
}
159159
```
160160

161-
```java
161+
```java title="LivingRoom.java"
162162
class LivingRoom {
163163
public void off() {
164164
System.out.println("Living Room Light is turned off");
@@ -178,7 +178,7 @@ class LivingRoom {
178178
}
179179
```
180180

181-
```java
181+
```java title="CeilingFan.java"
182182
class CeilingFan {
183183
public static final int OFF = 0;
184184
public static final int HIGH = 3;
@@ -214,7 +214,7 @@ class CeilingFan {
214214

215215
Now write the concrete Command classes. Each one wraps a Receiver and calls its methods.
216216

217-
```java
217+
```java title"LightOnCommand.java"
218218
class LightOnCommand implements Command {
219219
private Light light;
220220

@@ -239,7 +239,7 @@ class LightOnCommand implements Command {
239239
}
240240
```
241241

242-
```java
242+
```java title="LightOffCommand.java"
243243
class LightOffCommand implements Command {
244244
private Light light;
245245

@@ -264,7 +264,7 @@ class LightOffCommand implements Command {
264264
}
265265
```
266266

267-
```java
267+
```java title="LivingRoomOnCommand.java"
268268
class LivingRoomOnCommand implements Command {
269269
private LivingRoom livingroom;
270270

@@ -291,7 +291,7 @@ class LivingRoomOnCommand implements Command {
291291
}
292292
```
293293

294-
```java
294+
```java title="LivingRoomOffCommand.java"
295295
class LivingRoomOffCommand implements Command {
296296
private LivingRoom livingroom;
297297

@@ -322,7 +322,7 @@ You would follow the same pattern for the CeilingFan commands.
322322

323323
Finally, put everything together in the Invoker:
324324

325-
```java
325+
```java title="RemoteControl.java"
326326
class RemoteControl {
327327
private Command[] onCommands;
328328
private Command[] offCommands;

0 commit comments

Comments
 (0)