@Override public Point get(int i) { int offset = 0; for (Points points : pointsList) { if (i - offset < points.size()) { return points.get(i - offset); } offset += points.size(); } throw new NoSuchElementException(); }
@Override public int size() { int size = 0; for (Points points : pointsList) { size += points.size(); } return size; }