2 changed files with 67 additions and 0 deletions
@ -0,0 +1,11 @@ |
|||
package testat; |
|||
|
|||
/** |
|||
* |
|||
* @author cm |
|||
* |
|||
* @param <E> |
|||
*/ |
|||
public interface IAction<E> { |
|||
public void execute(E e); |
|||
} |
@ -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…
Reference in new issue