Back to project page powerstats.
The source code is released under:
GNU General Public License
If you think the Android project powerstats 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 com.znasibov.powerstats; /* w ww . j a v a2s . c o m*/ import java.util.LinkedHashSet; import java.util.Set; public class PowerRecordsListenerMixin { Set<PowerRecordsListener> prListeners; public PowerRecordsListenerMixin() { prListeners = new LinkedHashSet<>(); } public PowerRecordsListenerMixin(PowerRecordsListenerMixin other) { this.prListeners = new LinkedHashSet<>(other.prListeners); } public PowerRecordsListenerMixin copy() { return new PowerRecordsListenerMixin(this); } public void subscribe(PowerRecordsListener obj) { prListeners.add(obj); } public void unsubscribe(PowerRecordsListener obj) { prListeners.remove(obj); } public void notify(PowerRecord pr) { for (PowerRecordsListener l : prListeners) { l.recordReceived(pr); } } }