diff --git a/SimpleActivityStack/src/testat/IAction.java b/SimpleActivityStack/src/testat/IAction.java new file mode 100644 index 0000000..19b0b64 --- /dev/null +++ b/SimpleActivityStack/src/testat/IAction.java @@ -0,0 +1,11 @@ +package testat; + +/** + * + * @author cm + * + * @param + */ +public interface IAction { + public void execute(E e); +} diff --git a/SimpleActivityStack/src/testat/SimpleActivity.java b/SimpleActivityStack/src/testat/SimpleActivity.java new file mode 100644 index 0000000..9fdc945 --- /dev/null +++ b/SimpleActivityStack/src/testat/SimpleActivity.java @@ -0,0 +1,56 @@ +package testat; + +/** + * + * @author cm + * + */ +public class SimpleActivity { + + private String desc; + private String name; + private boolean isActive; + + public SimpleActivity(String name, String desc, boolean activityState) { + this.name = name; + this.setDesc(desc); + this.setActive(activityState); + } + + public SimpleActivity(String name) { + this.name = name; + this.setActive(true); + } + + public void activate() { + this.setActive(true); + } + + public void destroy() { + System.out.println(this.name + " is destroyed"); + } + + public void passivate() { + this.setActive(false); + } + + public boolean isActive() { + return isActive; + } + + public void setActive(boolean isActive) { + this.isActive = isActive; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + + public String getName() { + return name; + } +}