@Implements(android.location.Geocoder.class) public final class ShadowGeocoder extends Object
Constructor | Description |
---|---|
ShadowGeocoder() |
Modifier and Type | Method | Description |
---|---|---|
protected List<Address> |
getFromLocation(double latitude,
double longitude,
int maxResults) |
Returns an empty list by default, or the last value set by
setFromLocation(List) |
protected static boolean |
isPresent() |
|
static void |
reset() |
|
void |
setFromLocation(List<Address> list) |
Sets the value to be returned by
Geocoder.getFromLocation(double, double, int) . |
static void |
setIsPresent(boolean value) |
Sets the value to be returned by
Geocoder.isPresent() . |
@Implementation protected static boolean isPresent()
setIsPresent(boolean)
@Implementation protected List<Address> getFromLocation(double latitude, double longitude, int maxResults) throws IOException
setFromLocation(List)
{@param latitude} and {@param longitude} are ignored by this implementation, except to check that they are in appropriate bounds. {@param maxResults} determines the maximum number of addresses to return.
IOException
public static void setIsPresent(boolean value)
Geocoder.isPresent()
.
This value is reset to true for each test.
public void setFromLocation(List<Address> list)
Geocoder.getFromLocation(double, double, int)
.@Resetter public static void reset()