|
|
@ -0,0 +1,25 @@ |
|
|
|
package com.my.graphiteDigesterBg.diframe; |
|
|
|
public class DiTaskAction { |
|
|
|
// name of action |
|
|
|
public String name; |
|
|
|
// result of action |
|
|
|
public Object result; |
|
|
|
|
|
|
|
// finish action to notify all |
|
|
|
public void finish() { |
|
|
|
synchronized (this) { |
|
|
|
this.notifyAll(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// finish action with result to notify all |
|
|
|
public void finish(Object result) { |
|
|
|
this.result = result; |
|
|
|
this.finish(); |
|
|
|
} |
|
|
|
|
|
|
|
// get result |
|
|
|
public <T> T getResult(Class<T> clazz) { |
|
|
|
return clazz.cast(this.result); |
|
|
|
} |
|
|
|
} |