added command pattern example
This commit is contained in:
13
src/learn/simple_command/Invoker.java
Normal file
13
src/learn/simple_command/Invoker.java
Normal file
@@ -0,0 +1,13 @@
|
||||
package learn.simple_command;
|
||||
|
||||
public class Invoker {
|
||||
private Command slot;
|
||||
|
||||
public void setSlot(Command slot) {
|
||||
this.slot = slot;
|
||||
}
|
||||
|
||||
public void buttonWasPushed() {
|
||||
slot.execute();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user