001    package com.google.gwt.maps.client.services;
002    
003    import com.google.gwt.core.client.JavaScriptObject;
004    import com.google.gwt.core.client.JsArray;
005    import com.google.gwt.core.client.JsArrayString;
006    
007    /**
008     * A single geocoder result retrieved from the geocode server. A geocode request may return multiple result objects. Note that though this result is "JSON-like," it is not strictly JSON, as it indirectly includes a LatLng object.
009     * <br><br>
010     * See <a href="https://developers.google.com/maps/documentation/javascript/reference#GeocoderResult">GeocoderResult API Doc</a>
011     */
012    public class GeocoderResult extends JavaScriptObject {
013    
014      /**
015       * use newInstance();
016       */
017      protected GeocoderResult() {}
018      
019      /**
020       * A single geocoder result retrieved from the geocode server. A geocode request may return multiple result objects. Note that though this result is "JSON-like," it is not strictly JSON, as it indirectly includes a LatLng object.
021       */
022      public static final GeocoderResult newInstance() {
023        return JavaScriptObject.createObject().cast();
024      }
025      
026      /**
027       * An array of GeocoderAddressComponents
028       * @param address_components
029       */
030      public final native void setAddress_Components(JsArray<GeocoderAddressComponent> address_components) /*-{
031        this.address_components = address_components;
032      }-*/;
033      
034      /**
035       * An array of GeocoderAddressComponents
036       */
037      public final native JsArray<GeocoderAddressComponent> getAddress_Components() /*-{
038        return this.address_components;
039      }-*/;
040      
041      /**
042       * A string containing the human-readable address of this location.
043       * @param formatted_address
044       */
045      public final native void setFormatted_Address(String formatted_address) /*-{
046        this.formatted_address = formatted_address;
047      }-*/;
048      
049      /**
050       * A string containing the human-readable address of this location.
051       */
052      public final native String getFormatted_Address() /*-{
053        return this.formatted_address;
054      }-*/;
055      
056      /**
057       * A GeocoderGeometry object
058       * @param geometry
059       */
060      public final native void setGeometry(GeocoderGeometry geometry) /*-{
061        this.geometry = geometry;
062      }-*/;
063      
064      /**
065       * A GeocoderGeometry object
066       */
067      public final native GeocoderGeometry getGeometry() /*-{
068        return this.geometry;
069      }-*/;
070      
071      /**
072       * An array of strings denoting the type of the returned geocoded element. A type consists of a unique string identifying the geocode result. (For example, "administrative_area_level_1", "country", etc.)
073       * @param types
074       */
075      public final native void setTypes(JsArrayString types) /*-{
076        this.types = types;
077      }-*/;
078      
079      /**
080       * An array of strings denoting the type of the returned geocoded element. A type consists of a unique string identifying the geocode result. (For example, "administrative_area_level_1", "country", etc.)
081       */
082      public final native JsArrayString getTypes() /*-{
083        return this.types;
084      }-*/;
085      
086    }