wangzhibo
4 天以前 ae6f40460dcd56af6c5f60ba52c883854c3bac55
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
package net.osmand.aidlapi.search;
 
import android.os.Bundle;
import android.os.Parcel;
 
import net.osmand.aidlapi.AidlParams;
 
import java.util.ArrayList;
import java.util.List;
 
public class SearchResult extends AidlParams {
 
    private double latitude;
    private double longitude;
 
    private String localName;
    private String localTypeName;
 
    private String alternateName;
    private ArrayList<String> otherNames = new ArrayList<>();
 
 
    public SearchResult(double latitude, double longitude, String localName, String localTypeName,
                        String alternateName, List<String> otherNames) {
        this.latitude = latitude;
        this.longitude = longitude;
        this.localName = localName;
        this.localTypeName = localTypeName;
        this.alternateName = alternateName;
        if (otherNames != null) {
            this.otherNames.addAll(otherNames);
        }
    }
 
    public SearchResult(Parcel in) {
        readFromParcel(in);
    }
 
    public static final Creator<SearchResult> CREATOR = new Creator<SearchResult>() {
        @Override
        public SearchResult createFromParcel(Parcel in) {
            return new SearchResult(in);
        }
 
        @Override
        public SearchResult[] newArray(int size) {
            return new SearchResult[size];
        }
    };
 
    public double getLatitude() {
        return latitude;
    }
 
    public double getLongitude() {
        return longitude;
    }
 
    public String getLocalName() {
        return localName;
    }
 
    public String getLocalTypeName() {
        return localTypeName;
    }
 
    public String getAlternateName() {
        return alternateName;
    }
 
    public List<String> getOtherNames() {
        return otherNames;
    }
 
    @Override
    public void writeToBundle(Bundle bundle) {
        bundle.putDouble("latitude", latitude);
        bundle.putDouble("longitude", longitude);
        bundle.putString("localName", localName);
        bundle.putString("localTypeName", localTypeName);
        bundle.putString("alternateName", alternateName);
        bundle.putStringArrayList("otherNames", otherNames);
    }
 
    @Override
    protected void readFromBundle(Bundle bundle) {
        latitude = bundle.getDouble("latitude");
        longitude = bundle.getDouble("longitude");
        localName = bundle.getString("localName");
        localTypeName = bundle.getString("localTypeName");
        alternateName = bundle.getString("alternateName");
        otherNames = bundle.getStringArrayList("otherName");
    }
}