Browse Source

Erstellen der benötigten Klassen/Interfaces

- IAction
- SimpleActivity
vollständige_und_weitere_testate
chris 3 years ago
parent
commit
3037087aa5
  1. 11
      SimpleActivityStack/src/testat/IAction.java
  2. 56
      SimpleActivityStack/src/testat/SimpleActivity.java

11
SimpleActivityStack/src/testat/IAction.java

@ -0,0 +1,11 @@
package testat;
/**
*
* @author cm
*
* @param <E>
*/
public interface IAction<E> {
public void execute(E e);
}

56
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;
}
}
Loading…
Cancel
Save