56 lines
1.7 KiB
Java
56 lines
1.7 KiB
Java
package com.google.maps.android.data;
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.Iterator;
|
|
import java.util.List;
|
|
|
|
/* JADX INFO: loaded from: classes2.dex */
|
|
public class MultiGeometry implements Geometry {
|
|
private String geometryType = "MultiGeometry";
|
|
private List<Geometry> mGeometries;
|
|
|
|
public MultiGeometry(List<? extends Geometry> list) {
|
|
if (list == null) {
|
|
throw new IllegalArgumentException("Geometries cannot be null");
|
|
}
|
|
ArrayList arrayList = new ArrayList();
|
|
Iterator<? extends Geometry> it = list.iterator();
|
|
while (it.hasNext()) {
|
|
arrayList.add(it.next());
|
|
}
|
|
this.mGeometries = arrayList;
|
|
}
|
|
|
|
@Override // com.google.maps.android.data.Geometry
|
|
public String getGeometryType() {
|
|
return this.geometryType;
|
|
}
|
|
|
|
@Override // com.google.maps.android.data.Geometry
|
|
public List<Geometry> getGeometryObject() {
|
|
return this.mGeometries;
|
|
}
|
|
|
|
public void setGeometryType(String str) {
|
|
this.geometryType = str;
|
|
}
|
|
|
|
public String toString() {
|
|
String str;
|
|
if (!this.geometryType.equals("MultiPoint")) {
|
|
str = "Geometries=";
|
|
} else {
|
|
str = "LineStrings=";
|
|
}
|
|
if (this.geometryType.equals("MultiLineString")) {
|
|
str = "points=";
|
|
}
|
|
if (this.geometryType.equals("MultiPolygon")) {
|
|
str = "Polygons=";
|
|
}
|
|
StringBuilder sbAppend = new StringBuilder(getGeometryType()).append("{");
|
|
sbAppend.append("\n ".concat(str)).append(getGeometryObject());
|
|
sbAppend.append("\n}\n");
|
|
return sbAppend.toString();
|
|
}
|
|
} |