.class public Lcom/moji/location/geo/AmapGeoResultParser;
.super Ljava/lang/Object;
.source "AmapGeoResultParser.java"

# interfaces
.implements Lcom/moji/location/geo/IGeoResultParser;


# annotations
.annotation system Ldalvik/annotation/Signature;
    value = {
        "Ljava/lang/Object;",
        "Lcom/moji/location/geo/IGeoResultParser<",
        "Lcom/amap/api/services/geocoder/RegeocodeResult;",
        ">;"
    }
.end annotation


# direct methods
.method public constructor <init>()V
    .locals 0

    .line 13
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


# virtual methods
.method public a(Lcom/amap/api/services/geocoder/RegeocodeResult;)Lcom/moji/location/geo/MJReGeoCodeResult;
    .locals 10

    const/4 v0, 0x0

    if-nez p1, :cond_0

    return-object v0

    .line 20
    :cond_0
    invoke-virtual {p1}, Lcom/amap/api/services/geocoder/RegeocodeResult;->getRegeocodeQuery()Lcom/amap/api/services/geocoder/RegeocodeQuery;

    move-result-object v1

    if-eqz v1, :cond_1

    .line 23
    invoke-virtual {v1}, Lcom/amap/api/services/geocoder/RegeocodeQuery;->getPoint()Lcom/amap/api/services/core/LatLonPoint;

    move-result-object v2

    .line 24
    new-instance v3, Lcom/moji/location/geo/MJLatLonPoint;

    invoke-virtual {v2}, Lcom/amap/api/services/core/LatLonPoint;->getLatitude()D

    move-result-wide v4

    invoke-virtual {v2}, Lcom/amap/api/services/core/LatLonPoint;->getLongitude()D

    move-result-wide v6

    invoke-direct {v3, v4, v5, v6, v7}, Lcom/moji/location/geo/MJLatLonPoint;-><init>(DD)V

    .line 25
    new-instance v2, Lcom/moji/location/geo/MJReGeoCodeQuery;

    invoke-virtual {v1}, Lcom/amap/api/services/geocoder/RegeocodeQuery;->getRadius()F

    move-result v1

    invoke-direct {v2, v3, v1}, Lcom/moji/location/geo/MJReGeoCodeQuery;-><init>(Lcom/moji/location/geo/MJLatLonPoint;F)V

    goto :goto_0

    :cond_1
    move-object v2, v0

    .line 28
    :goto_0
    invoke-virtual {p1}, Lcom/amap/api/services/geocoder/RegeocodeResult;->getRegeocodeAddress()Lcom/amap/api/services/geocoder/RegeocodeAddress;

    move-result-object p1

    if-eqz p1, :cond_5

    .line 31
    new-instance v0, Lcom/moji/location/geo/MJReGeoCodeAddress;

    invoke-direct {v0}, Lcom/moji/location/geo/MJReGeoCodeAddress;-><init>()V

    .line 32
    invoke-virtual {p1}, Lcom/amap/api/services/geocoder/RegeocodeAddress;->getAdCode()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Lcom/moji/location/geo/MJReGeoCodeAddress;->setAdCode(Ljava/lang/String;)V

    .line 33
    invoke-virtual {p1}, Lcom/amap/api/services/geocoder/RegeocodeAddress;->getBuilding()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Lcom/moji/location/geo/MJReGeoCodeAddress;->setBuilding(Ljava/lang/String;)V

    .line 34
    invoke-virtual {p1}, Lcom/amap/api/services/geocoder/RegeocodeAddress;->getCity()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Lcom/moji/location/geo/MJReGeoCodeAddress;->setCity(Ljava/lang/String;)V

    .line 35
    invoke-virtual {p1}, Lcom/amap/api/services/geocoder/RegeocodeAddress;->getCityCode()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Lcom/moji/location/geo/MJReGeoCodeAddress;->setCityCode(Ljava/lang/String;)V

    .line 36
    invoke-virtual {p1}, Lcom/amap/api/services/geocoder/RegeocodeAddress;->getDistrict()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Lcom/moji/location/geo/MJReGeoCodeAddress;->setDistrict(Ljava/lang/String;)V

    .line 37
    invoke-virtual {p1}, Lcom/amap/api/services/geocoder/RegeocodeAddress;->getFormatAddress()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Lcom/moji/location/geo/MJReGeoCodeAddress;->setFormatAddress(Ljava/lang/String;)V

    .line 38
    invoke-virtual {p1}, Lcom/amap/api/services/geocoder/RegeocodeAddress;->getNeighborhood()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Lcom/moji/location/geo/MJReGeoCodeAddress;->setNeighborhood(Ljava/lang/String;)V

    .line 39
    invoke-virtual {p1}, Lcom/amap/api/services/geocoder/RegeocodeAddress;->getProvince()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Lcom/moji/location/geo/MJReGeoCodeAddress;->setProvince(Ljava/lang/String;)V

    .line 40
    invoke-virtual {p1}, Lcom/amap/api/services/geocoder/RegeocodeAddress;->getTownship()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Lcom/moji/location/geo/MJReGeoCodeAddress;->setTownship(Ljava/lang/String;)V

    .line 41
    invoke-virtual {p1}, Lcom/amap/api/services/geocoder/RegeocodeAddress;->getRoads()Ljava/util/List;

    move-result-object p1

    .line 42
    new-instance v1, Ljava/util/ArrayList;

    invoke-direct {v1}, Ljava/util/ArrayList;-><init>()V

    if-eqz p1, :cond_4

    .line 43
    invoke-interface {p1}, Ljava/util/List;->isEmpty()Z

    move-result v3

    if-nez v3, :cond_4

    .line 47
    invoke-interface {p1}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object p1

    :cond_2
    :goto_1
    invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z

    move-result v3

    if-eqz v3, :cond_4

    invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Lcom/amap/api/services/geocoder/RegeocodeRoad;

    if-eqz v3, :cond_2

    .line 49
    new-instance v4, Lcom/moji/location/geo/MJReGeoCodeRoad;

    invoke-direct {v4}, Lcom/moji/location/geo/MJReGeoCodeRoad;-><init>()V

    .line 50
    invoke-virtual {v3}, Lcom/amap/api/services/geocoder/RegeocodeRoad;->getDirection()Ljava/lang/String;

    move-result-object v5

    invoke-virtual {v4, v5}, Lcom/moji/location/geo/MJReGeoCodeRoad;->setDirection(Ljava/lang/String;)V

    .line 51
    invoke-virtual {v3}, Lcom/amap/api/services/geocoder/RegeocodeRoad;->getDistance()F

    move-result v5

    invoke-virtual {v4, v5}, Lcom/moji/location/geo/MJReGeoCodeRoad;->setDistance(F)V

    .line 52
    invoke-virtual {v3}, Lcom/amap/api/services/geocoder/RegeocodeRoad;->getId()Ljava/lang/String;

    move-result-object v5

    invoke-virtual {v4, v5}, Lcom/moji/location/geo/MJReGeoCodeRoad;->setId(Ljava/lang/String;)V

    .line 53
    invoke-virtual {v3}, Lcom/amap/api/services/geocoder/RegeocodeRoad;->getName()Ljava/lang/String;

    move-result-object v5

    invoke-virtual {v4, v5}, Lcom/moji/location/geo/MJReGeoCodeRoad;->setName(Ljava/lang/String;)V

    .line 54
    invoke-virtual {v3}, Lcom/amap/api/services/geocoder/RegeocodeRoad;->getLatLngPoint()Lcom/amap/api/services/core/LatLonPoint;

    move-result-object v3

    if-eqz v3, :cond_3

    .line 56
    new-instance v5, Lcom/moji/location/geo/MJLatLonPoint;

    invoke-virtual {v3}, Lcom/amap/api/services/core/LatLonPoint;->getLatitude()D

    move-result-wide v6

    invoke-virtual {v3}, Lcom/amap/api/services/core/LatLonPoint;->getLongitude()D

    move-result-wide v8

    invoke-direct {v5, v6, v7, v8, v9}, Lcom/moji/location/geo/MJLatLonPoint;-><init>(DD)V

    .line 57
    invoke-virtual {v4, v5}, Lcom/moji/location/geo/MJReGeoCodeRoad;->setLatLngPoint(Lcom/moji/location/geo/MJLatLonPoint;)V

    .line 59
    :cond_3
    invoke-interface {v1, v4}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    goto :goto_1

    .line 63
    :cond_4
    invoke-virtual {v0, v1}, Lcom/moji/location/geo/MJReGeoCodeAddress;->setRoads(Ljava/util/List;)V

    .line 66
    :cond_5
    new-instance p1, Lcom/moji/location/geo/MJReGeoCodeResult;

    invoke-direct {p1, v2, v0}, Lcom/moji/location/geo/MJReGeoCodeResult;-><init>(Lcom/moji/location/geo/MJReGeoCodeQuery;Lcom/moji/location/geo/MJReGeoCodeAddress;)V

    return-object p1
.end method

.method public bridge synthetic a(Ljava/lang/Object;)Lcom/moji/location/geo/MJReGeoCodeResult;
    .locals 0

    .line 13
    check-cast p1, Lcom/amap/api/services/geocoder/RegeocodeResult;

    invoke-virtual {p0, p1}, Lcom/moji/location/geo/AmapGeoResultParser;->a(Lcom/amap/api/services/geocoder/RegeocodeResult;)Lcom/moji/location/geo/MJReGeoCodeResult;

    move-result-object p1

    return-object p1
.end method
