org.osmdroid.tileprovider.MapTileRequestState Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of osmdroid-android Show documentation
Show all versions of osmdroid-android Show documentation
An Android library to display OpenStreetMap views.
package org.osmdroid.tileprovider;
import java.util.Collections;
import java.util.LinkedList;
import java.util.Queue;
import org.osmdroid.tileprovider.modules.MapTileModuleProviderBase;
public class MapTileRequestState {
private final Queue mProviderQueue;
private final MapTile mMapTile;
private final IMapTileProviderCallback mCallback;
private MapTileModuleProviderBase mCurrentProvider;
public MapTileRequestState(final MapTile mapTile,
final MapTileModuleProviderBase[] providers,
final IMapTileProviderCallback callback) {
mProviderQueue = new LinkedList();
Collections.addAll(mProviderQueue, providers);
mMapTile = mapTile;
mCallback = callback;
}
public MapTile getMapTile() {
return mMapTile;
}
public IMapTileProviderCallback getCallback() {
return mCallback;
}
public boolean isEmpty() {
return mProviderQueue.isEmpty();
}
public MapTileModuleProviderBase getNextProvider() {
mCurrentProvider = mProviderQueue.poll();
return mCurrentProvider;
}
public MapTileModuleProviderBase getCurrentProvider() {
return mCurrentProvider;
}
}