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