Back to project page latrobe-datacapture-dir.
The source code is released under:
MIT License
If you think the Android project latrobe-datacapture-dir 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.example.DataCaptureApp.utils; /*from www .ja v a 2 s . c o m*/ import com.example.DataCaptureApp.data.Data; import com.example.DataCaptureApp.data.IDataListener; import com.example.DataCaptureApp.data.IDataSource; import java.util.LinkedList; import java.util.List; /** * Created by Tom on 27/10/2014. */ public class BroadcastDataSource implements IDataSource, IDataListener { private List<IDataListener> mListeners; public BroadcastDataSource() { mListeners = new LinkedList<IDataListener>(); } @Override public void onData(IDataSource source, Data data) { for(IDataListener listener : mListeners) { listener.onData(source, data); } } @Override public void setDataListener(IDataListener listener) { if(!mListeners.contains(listener)) mListeners.add(listener); } public void removeDataListener(IDataListener listener) { mListeners.remove(listener); } }