|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.xtremelabs.robolectric.shadows.ShadowGeocoder
@Implements(value=android.location.Geocoder.class) public class ShadowGeocoder
A shadow for Geocoder that supports simulated responses and failures
Constructor Summary | |
---|---|
ShadowGeocoder()
|
Method Summary | |
---|---|
java.util.List<android.location.Address> |
getFromLocation(double latitude,
double longitude,
int maxResults)
|
java.util.List<android.location.Address> |
getFromLocationName(java.lang.String locationName,
int maxResults)
|
double |
getLastLatitude()
|
double |
getLastLongitude()
|
void |
setShouldSimulateGeocodeException(boolean shouldSimulateException)
Sets a flag to indicate whether or not getFromLocationName(String, int) should throw an exception to
simulate a failure. |
void |
setSimulatedLatLong(double lat,
double lng)
Sets up a simulated response for getFromLocationName(String, int) } |
void |
setSimulatedResponse(java.lang.String address,
java.lang.String city,
java.lang.String state,
java.lang.String zip,
java.lang.String countryCode)
Sets up a simulated response for getFromLocation(double, double, int) |
boolean |
wasGetFromLocationCalled()
Non-Android accessor that indicates whether getFromLocation(double, double, int) was called. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ShadowGeocoder()
Method Detail |
---|
@Implementation public java.util.List<android.location.Address> getFromLocation(double latitude, double longitude, int maxResults) throws java.io.IOException
java.io.IOException
@Implementation public java.util.List<android.location.Address> getFromLocationName(java.lang.String locationName, int maxResults) throws java.io.IOException
java.io.IOException
public void setSimulatedResponse(java.lang.String address, java.lang.String city, java.lang.String state, java.lang.String zip, java.lang.String countryCode)
getFromLocation(double, double, int)
address
- the address for the responsecity
- the city for the responsestate
- the state for the responsezip
- the zip code for the responsecountryCode
- the country code for the responsepublic void setSimulatedLatLong(double lat, double lng)
getFromLocationName(String, int)
}
lat
- latitude for simulated responselng
- longitude for simulated responsepublic void setShouldSimulateGeocodeException(boolean shouldSimulateException)
getFromLocationName(String, int)
should throw an exception to
simulate a failure.
shouldSimulateException
- whether or not an exception should be thrown from getFromLocationName(String, int)
public boolean wasGetFromLocationCalled()
getFromLocation(double, double, int)
was called.
getFromLocation(double, double, int)
was called.public double getLastLongitude()
public double getLastLatitude()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |