Addressed Rodrigo's comments.

This commit is contained in:
bartn
2010-12-16 17:46:27 -08:00
parent e6c8458ce7
commit 0e397797b4
2 changed files with 12 additions and 4 deletions
@@ -312,7 +312,7 @@ public interface MyTracksProviderUtils {
Waypoint createWaypoint(Cursor cursor); Waypoint createWaypoint(Cursor cursor);
/** /**
* A lightweight wrapper around the original {@link Iterator} with a method to clean up. * A lightweight wrapper around the original {@link Cursor} with a method to clean up.
*/ */
interface LocationIterator extends Iterator<Location> { interface LocationIterator extends Iterator<Location> {
/** /**
@@ -325,11 +325,19 @@ public interface MyTracksProviderUtils {
* A factory for creating new {@class Location}s. * A factory for creating new {@class Location}s.
*/ */
interface LocationFactory { interface LocationFactory {
/**
* Creates a new {@link Location} object to be populated from the underlying database record.
* It's up to the implementing class to decide whether to create a new instance or reuse
* existing to optimize for speed.
*
* @return a {@link Location} to be populated from the database.
*/
Location createLocation(); Location createLocation();
} }
/** /**
* The default {@class Location}s factory, which creates a new location of 'gps' type. * The default {@class Location}s factory, which creates a new location of 'gps' type each
* time the user advances to the next element using {@link LocationIterator#next()} method.
*/ */
LocationFactory DEFAULT_LOCATION_FACTORY = new LocationFactory() { LocationFactory DEFAULT_LOCATION_FACTORY = new LocationFactory() {
@Override @Override
@@ -936,8 +936,8 @@ public class MyTracksProviderUtilsImpl implements MyTracksProviderUtils {
} }
@Override @Override
public LocationIterator getLocationIterator(long trackId, public LocationIterator getLocationIterator(long trackId, LocationFactory locationFactory) {
LocationFactory locationFactory) { // TODO: Implement it.
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
} }