package com.google.android.m4b.maps.model;

import android.os.Parcel;
import com.google.android.m4b.maps.g.j;
import com.google.android.m4b.maps.g.j.a;
import com.google.android.m4b.maps.g.l;
import com.google.android.m4b.maps.h.c;
import com.google.android.m4b.maps.r.ap;
import java.util.Arrays;

public final class LatLngBounds
  implements c
{
  public static final LatLngBoundsCreator CREATOR = new LatLngBoundsCreator();
  private final int a;
  public final LatLng northeast;
  public final LatLng southwest;

  LatLngBounds(int paramInt, LatLng paramLatLng1, LatLng paramLatLng2)
  {
    l.a(paramLatLng1, "null southwest");
    l.a(paramLatLng2, "null northeast");
    if (paramLatLng2.latitude >= paramLatLng1.latitude);
    for (boolean bool = true; ; bool = false)
    {
      Object[] arrayOfObject = new Object[2];
      arrayOfObject[0] = Double.valueOf(paramLatLng1.latitude);
      arrayOfObject[1] = Double.valueOf(paramLatLng2.latitude);
      l.a(bool, "southern latitude exceeds northern latitude (%s > %s)", arrayOfObject);
      this.a = paramInt;
      this.southwest = paramLatLng1;
      this.northeast = paramLatLng2;
      return;
    }
  }

  public LatLngBounds(LatLng paramLatLng1, LatLng paramLatLng2)
  {
    this(1, paramLatLng1, paramLatLng2);
  }

  private boolean a(double paramDouble)
  {
    if (this.southwest.longitude <= this.northeast.longitude)
      if ((this.southwest.longitude > paramDouble) || (paramDouble > this.northeast.longitude));
    while ((this.southwest.longitude <= paramDouble) || (paramDouble <= this.northeast.longitude))
    {
      return true;
      return false;
    }
    return false;
  }

  public static Builder builder()
  {
    return new Builder();
  }

  private static double c(double paramDouble1, double paramDouble2)
  {
    return (360.0D + (paramDouble1 - paramDouble2)) % 360.0D;
  }

  private static double d(double paramDouble1, double paramDouble2)
  {
    return (360.0D + (paramDouble2 - paramDouble1)) % 360.0D;
  }

  final int a()
  {
    return this.a;
  }

  public final boolean contains(LatLng paramLatLng)
  {
    double d = paramLatLng.latitude;
    if ((this.southwest.latitude <= d) && (d <= this.northeast.latitude));
    for (int i = 1; (i != 0) && (a(paramLatLng.longitude)); i = 0)
      return true;
    return false;
  }

  public final int describeContents()
  {
    return 0;
  }

  public final boolean equals(Object paramObject)
  {
    if (this == paramObject);
    LatLngBounds localLatLngBounds;
    do
    {
      return true;
      if (!(paramObject instanceof LatLngBounds))
        return false;
      localLatLngBounds = (LatLngBounds)paramObject;
    }
    while ((this.southwest.equals(localLatLngBounds.southwest)) && (this.northeast.equals(localLatLngBounds.northeast)));
    return false;
  }

  public final LatLng getCenter()
  {
    double d1 = (this.southwest.latitude + this.northeast.latitude) / 2.0D;
    double d2 = this.northeast.longitude;
    double d3 = this.southwest.longitude;
    if (d3 <= d2);
    for (double d4 = (d2 + d3) / 2.0D; ; d4 = (d3 + (d2 + 360.0D)) / 2.0D)
      return new LatLng(d1, d4);
  }

  public final int hashCode()
  {
    Object[] arrayOfObject = new Object[2];
    arrayOfObject[0] = this.southwest;
    arrayOfObject[1] = this.northeast;
    return Arrays.hashCode(arrayOfObject);
  }

  public final LatLngBounds including(LatLng paramLatLng)
  {
    double d1 = Math.min(this.southwest.latitude, paramLatLng.latitude);
    double d2 = Math.max(this.northeast.latitude, paramLatLng.latitude);
    double d3 = this.northeast.longitude;
    double d4 = this.southwest.longitude;
    double d5 = paramLatLng.longitude;
    double d6;
    if (!a(d5))
      if (c(d4, d5) < d(d3, d5))
        d6 = d3;
    while (true)
    {
      return new LatLngBounds(new LatLng(d1, d5), new LatLng(d2, d6));
      d6 = d5;
      d5 = d4;
      continue;
      d5 = d4;
      d6 = d3;
    }
  }

  public final String toString()
  {
    return j.a(this).a("southwest", this.southwest).a("northeast", this.northeast).toString();
  }

  public final void writeToParcel(Parcel paramParcel, int paramInt)
  {
    if (ap.a())
    {
      LatLngBoundsCreatorCheddar.a(this, paramParcel, paramInt);
      return;
    }
    LatLngBoundsCreator.a(this, paramParcel, paramInt);
  }

  public static final class Builder
  {
    private double a = (1.0D / 0.0D);
    private double b = (-1.0D / 0.0D);
    private double c = (0.0D / 0.0D);
    private double d = (0.0D / 0.0D);

    public final LatLngBounds build()
    {
      if (!Double.isNaN(this.c));
      for (boolean bool = true; ; bool = false)
      {
        l.a(bool, "no included points");
        return new LatLngBounds(new LatLng(this.a, this.c), new LatLng(this.b, this.d));
      }
    }

    public final Builder include(LatLng paramLatLng)
    {
      int i = 1;
      this.a = Math.min(this.a, paramLatLng.latitude);
      this.b = Math.max(this.b, paramLatLng.latitude);
      double d1 = paramLatLng.longitude;
      if (Double.isNaN(this.c))
      {
        this.c = d1;
        this.d = d1;
      }
      label146: 
      while (true)
      {
        return this;
        if (this.c <= this.d)
          if ((this.c > d1) || (d1 > this.d));
        while (true)
        {
          if (i != 0)
            break label146;
          if (LatLngBounds.a(this.c, d1) >= LatLngBounds.b(this.d, d1))
            break;
          this.c = d1;
          return this;
          i = 0;
          continue;
          if ((this.c > d1) && (d1 > this.d))
            i = 0;
        }
      }
    }
  }
}

/* Location:           C:\Documents and Settings\Cesar Cabello Cea\Mis documentos\Downloads\apk-downloader\com.ikea.kompis-6_dex2jar.jar
 * Qualified Name:     com.google.android.m4b.maps.model.LatLngBounds
 * JD-Core Version:    0.6.2
 */