Class ShadowGeocoder


  • @Implements(android.location.Geocoder.class)
    public final class ShadowGeocoder
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      ShadowGeocoder()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method 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().
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ShadowGeocoder

        public ShadowGeocoder()
    • Method Detail

      • isPresent

        @Implementation
        protected static boolean isPresent()
        Returns:
        true by default, or the value specified via setIsPresent(boolean)
      • getFromLocation

        @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)

        {@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.

        Throws:
        java.io.IOException
      • setIsPresent

        public static void setIsPresent​(boolean value)
        Sets the value to be returned by Geocoder.isPresent().

        This value is reset to true for each test.

      • setFromLocation

        public void setFromLocation​(java.util.List<android.location.Address> list)
        Sets the value to be returned by Geocoder.getFromLocation(double, double, int).
      • reset

        @Resetter
        public static void reset()