Back to project page SpeechWriter.
The source code is released under:
MIT License
If you think the Android project SpeechWriter 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 edu.psu.rcy5017.speechwriter.task; /*ww w . ja v a 2 s.c o m*/ import java.util.List; import edu.psu.rcy5017.speechwriter.datasource.DataSource; import android.os.AsyncTask; /** * A task that gets all of the elements from a particular table corresponding to a Datasource. * @author Ryan Yosua * * @param <E> The type of the element that your task will return. This will be one of the types from the model package. */ public class GetAllTask<E> extends AsyncTask<Void, Void, List<E>> { private final DataSource<E> datasource; private final long parentID; /** * * @param datasource the data source to fetch from. * @param parentID the id of the parent that you are fetching from, use 0 if none. Example: if you are fetching note cards, the parentID would be the id of the speech that they belong to. */ public GetAllTask(DataSource<E> datasource, long parentID) { this.datasource = datasource; this.parentID = parentID; } @Override protected List<E> doInBackground(Void... params) { datasource.open(); final List<E> values = datasource.getAll(parentID); datasource.close(); return values; } }