Back to project page WhatsUp.
The source code is released under:
GNU General Public License
If you think the Android project WhatsUp listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package nu.placebo.whatsup.network; /*from www . j a va2 s . co m*/ import java.util.ArrayList; import java.util.List; /** * * Abstract class that helps NetworkOperations to handle their listeners. * */ public abstract class AbstractNetworkOperation<T> implements NetworkOperation<T> { private List<NetworkOperationListener<T>> listeners = new ArrayList<NetworkOperationListener<T>>(); private OperationResult<T> operationResult; public final void addOperationListener(NetworkOperationListener<T> listener) { this.listeners.add(listener); } public void notifyListeners(OperationResult<T> result) { for (NetworkOperationListener<T> listener : this.listeners) { listener.operationExcecuted(result); } } public final OperationResult<T> getResult() { return this.operationResult; } public final void setOperationResult(OperationResult<T> result) { this.operationResult = result; } }