Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Stack {
- private final ArrayList<float> backend;
- public void push(float value) {
- }
- }
- interface Command {
- void Execute(Stack target);
- }
- class CommandPush implements Command {
- @Override
- public void Execute(Stack target) {
- target.push();
- }
- }
- private java.util.HashMap<String, Callable<Command>> commandsConstructor;
- void prepareCommands() {
- commandsConstructor = new HashMap<>();
- commandsConstructor.put("PUSH", o -> new PushCommand());
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement