package com.mogo.map; import android.os.Parcel; import android.os.Parcelable; import java.util.Objects; /** * @author congtaowang * @since 2019-12-18 *

* 经纬度 */ public class MogoLatLng implements Parcelable { public final double lat; @Deprecated public final double lng; public final double lon; public long time; public MogoLatLng( double lat, double lon ) { this.lat = lat; this.lng = lon; this.lon = lon; } public double getLat() { return lat; } /** * Deprecated, use {@link #getLon()} instead. * * @return */ @Deprecated public double getLng() { return lng; } public double getLon() { return lon; } public long getTime() { return time; } public void setTime( long time ) { this.time = time; } @Override public boolean equals( Object o ) { if ( this == o ) return true; if ( o == null || getClass() != o.getClass() ) return false; MogoLatLng latLng = ( MogoLatLng ) o; return Double.compare( latLng.lat, lat ) == 0 && Double.compare( latLng.lon, lon ) == 0; } @Override public int hashCode() { return Objects.hash( lat, lng, lon ); } @Override public String toString() { return "MogoLatLng{" + "lat=" + lat + ", lon=" + lon + '}'; } @Override public int describeContents() { return 0; } @Override public void writeToParcel( Parcel dest, int flags ) { dest.writeDouble( this.lat ); dest.writeDouble( this.lng ); dest.writeDouble( this.lon ); dest.writeLong( this.time ); } protected MogoLatLng( Parcel in ) { this.lat = in.readDouble(); this.lng = in.readDouble(); this.lon = in.readDouble(); this.time = in.readLong(); } public static final Creator< MogoLatLng > CREATOR = new Creator< MogoLatLng >() { @Override public MogoLatLng createFromParcel( Parcel source ) { return new MogoLatLng( source ); } @Override public MogoLatLng[] newArray( int size ) { return new MogoLatLng[size]; } }; }