如何ArrayList<Object> points
基于二维数组创建datapoints
?
另一个问题:如果datapoints
是二维ArrayList,如何将第一列lat
和第二列读入lon
?
public class Cluster {
private ArrayList<VisitPoint> points;
public Cluster(List[][] datapoints) {
Float lat;
Float lon;
for (int i=0; i<datapoints.length; i++) {
lat = datapoints[i][0];
lon = datapoints[i][1];
points.add(new VisitPoint(lat,lon));
}
}
public ArrayList<VisitPoint> getVisitPoints() {
return points;
}
}