Datasets:
ArXiv:
License:
Stack-Repo / data /test /Hugo-Gao /Design-pattern /CommandPattern /src /SimpleSlot /MacroOnCommand.java
Download data/test/Hugo-Gao/Design-pattern/CommandPattern/src/SimpleSlot/MacroOnCommand.java from RepoFusion/Stack-Repo: direct link, hf CLI and curl.
- Browser
- Download file 557 Bytes
-
https://huggingface.co/datasets/RepoFusion/Stack-Repo/resolve/main/data/test/Hugo-Gao/Design-pattern/CommandPattern/src/SimpleSlot/MacroOnCommand.java
- Command line
-
hf download hf://datasets/RepoFusion/Stack-Repo/data/test/Hugo-Gao/Design-pattern/CommandPattern/src/SimpleSlot/MacroOnCommand.java
-
curl -L -o MacroOnCommand.java https://huggingface.co/datasets/RepoFusion/Stack-Repo/resolve/main/data/test/Hugo-Gao/Design-pattern/CommandPattern/src/SimpleSlot/MacroOnCommand.java
557 Bytes
| package SimpleSlot; | |
| /** | |
| * Created by Administrator on 2017/6/19. | |
| */ | |
| public class MacroOnCommand implements Command | |
| { | |
| private Command[] commands; | |
| public MacroOnCommand(Command[] commands) | |
| { | |
| this.commands = commands; | |
| } | |
| public void execute() | |
| { | |
| for (int i = 0; i < commands.length; i++) | |
| { | |
| commands[i].execute(); | |
| } | |
| } | |
| public void undo() | |
| { | |
| for (int i = 0; i < commands.length; i++) | |
| { | |
| commands[i].undo(); | |
| } | |
| } | |
| } | |