@Override public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { builder.startObject(); builder.field(FIELD_TYPE, TYPE.shapename); builder.startArray(FIELD_GEOMETRIES); for (ShapeBuilder shape : shapes) { shape.toXContent(builder, params); } builder.endArray(); return builder.endObject(); }
@Override public Shape build() { List<Shape> shapes = new ArrayList<>(this.shapes.size()); for (ShapeBuilder shape : this.shapes) { shapes.add(shape.build()); } if (shapes.size() == 1) return shapes.get(0); else return new XShapeCollection<>(shapes, SPATIAL_CONTEXT); // note: ShapeCollection is probably faster than a Multi* geom. }
/* */ public void applyTo(Polyline paramPolyline) /* */ { /* 20 */ super.applyTo(paramPolyline); /* 21 */ if (this.__set) paramPolyline.getPoints().addAll(this.points); /* */ }