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     * The response to a DistanceMatrixService request, consisting of the formatted origin and destination addresses, and a sequence of DistanceMatrixResponseRows, one for each corresponding origin address.
009     * <br><br>
010     * See <a href="https://developers.google.com/maps/documentation/javascript/reference#DistanceMatrixResponse">DistanceMatrixResponse API Doc</a>
011     */
012    public class DistanceMatrixResponse extends JavaScriptObject {
013    
014      /**
015       * this is generated from callback
016       * use newInstance();
017       */
018      protected DistanceMatrixResponse() {}
019      
020      /**
021       * The response to a DistanceMatrixService request, consisting of the formatted origin and destination addresses, and a sequence of DistanceMatrixResponseRows, one for each corresponding origin address.
022       */
023      public static final DistanceMatrixResponse newInstance() {
024        return createJso().cast();
025      }
026    
027      private static final native JavaScriptObject createJso() /*-{
028        return new $wnd.google.maps.DistanceMatrixResponse();
029      }-*/;
030      
031      /**
032       * The formatted destination addresses.
033       * @param destinationAddresses
034       */
035      public final native void setDestinationAddresses(JsArrayString destinationAddresses) /*-{
036        this.destinationAddresses = destinationAddresses;
037      }-*/;
038      
039      /**
040       * The formatted destination addresses.
041       */
042      public final native JsArrayString getDestinationAddresses() /*-{
043        return this.destinationAddresses;
044      }-*/;
045      
046      /**
047       * The formatted origin addresses.
048       * @param originAddresses
049       */
050      public final native void setOriginAddresses(JsArrayString originAddresses) /*-{
051        this.originAddresses = originAddresses;
052      }-*/;
053      
054      /**
055       * The formatted origin addresses.
056       */
057      public final native JsArrayString getOriginAddresses() /*-{
058        return this.originAddresses;
059      }-*/;
060     
061      /**
062       * The rows of the matrix, corresponding to the origin addresses.
063       * @param rows
064       */
065      public final native void setRows(JsArray<DistanceMatrixResponseRow> rows) /*-{
066        this.rows = rows;
067      }-*/;
068      
069      /**
070       * The rows of the matrix, corresponding to the origin addresses.
071       */
072      public final native JsArray<DistanceMatrixResponseRow> getRows() /*-{
073        return this.rows;
074      }-*/;
075      
076    }