|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.google.providerhelper.Reader<T>
public class Reader<T extends Builder>
Provides a java-style iterator over objects retrieved from rows of an Android ContentProvider; the objects' class must extend Builder.
Here is an example of the use of this class to process Call objects which represent entries in the phone-call log, assuming that Call extends Builder.
Reader<Call> calls = new Reader<Call>(Call.class, activity,
CallLog.Calls.CONTENT_URI);
for (Call call : calls) {
// do something with call
}
Builder| Constructor Summary | |
|---|---|
Reader(java.lang.Class<T> rowClass,
Activity a,
Uri u)
Creates a reader given a class to load, an Activity, and a Content-Provider Uri. |
|
Reader(java.lang.Class<T> rowClass,
Cursor cursor)
Creates a reader given a class to load and a Cursor to read from. |
|
| Method Summary | |
|---|---|
boolean |
hasNext()
|
java.util.Iterator<T> |
iterator()
|
T |
next()
|
void |
remove()
Not implemented. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Reader(java.lang.Class<T> rowClass,
Activity a,
Uri u)
row - The class of the object which is to be loaded. Must extend
Builder.a - The current activity.u - The Uri which identifies the Content Provider to load from.
public Reader(java.lang.Class<T> rowClass,
Cursor cursor)
The - class of the object which is to be loaded. Must extend
Builder.The - android.database.Cursor to read from.| Method Detail |
|---|
public boolean hasNext()
hasNext in interface java.util.Iterator<T extends Builder>public T next()
next in interface java.util.Iterator<T extends Builder>public void remove()
remove in interface java.util.Iterator<T extends Builder>public java.util.Iterator<T> iterator()
iterator in interface java.lang.Iterable<T extends Builder>
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||