Back to project page AndroSol.
The source code is released under:
MIT License
If you think the Android project AndroSol 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 lib.cards.models; //from ww w .j a va 2 s. com import java.util.ArrayList; public abstract class EventHandler<TEventInterface, TEventObject> { private ArrayList<TEventInterface> listeners = new ArrayList<TEventInterface>(); public void add(TEventInterface listener) { listeners.add(listener); } public void remove(TEventInterface listener) { listeners.remove(listener); } public boolean hasListeners() { return listeners.size() > 0; } public void notifyListeners(TEventObject eventObject) { for (TEventInterface listener : listeners) { notifyListener(listener, eventObject); } } protected abstract void notifyListener(TEventInterface listener, TEventObject eventObject); }