actually use iterator interface for ParcelableFileCache in activities

This commit is contained in:
Vincent Breitmoser
2014-10-03 04:06:44 +02:00
parent 04c8d42436
commit 504064302b
4 changed files with 52 additions and 19 deletions

View File

@@ -55,6 +55,10 @@ public class ParcelableFileCache<E extends Parcelable> {
mFilename = filename;
}
/** This method returns the number of entries as valid for the iterator
* received by the latest readCache operation. Yes, it is slightly
* peculiar.
*/
public int getNumEntries() {
return mNumEntries;
}
@@ -107,7 +111,7 @@ public class ParcelableFileCache<E extends Parcelable> {
throw new IOException(e);
}
// yes this is slightly sloppy data flow. WE WOULDN'T NEED THIS WITH TUPLE RETURN TYPES
// yes this is sloppy data flow. WE WOULDN'T NEED THIS WITH TUPLE RETURN TYPES
mNumEntries = ois.readInt();
return new Iterator<E>() {