/Prototipo/PrototipoCommons/src/memoria/commons/structures/MultiPolygon.java
Java | 74 lines | 46 code | 20 blank | 8 comment | 1 complexity | a3fea954e16551ea52383d52f99b5f92 MD5 | raw file
Possible License(s): BSD-3-Clause
- /*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
- package memoria.commons.structures;
- import java.util.ArrayList;
- import java.util.List;
- /**
- *
- * @author diego
- */
- public class MultiPolygon extends AbstractGeographicElement {
- private Polygon outerRing;
- private List<Polygon> poligonos = new ArrayList<Polygon>();
- public List<Polygon> getLineas() {
- return poligonos;
- }
- @Override
- public String getTypeRepresentation()
- {
- return "Multipolygon";
- }
- public void setLineas(List<Polygon> lineas) {
- this.poligonos = lineas;
- }
- public MultiPolygon(Polygon outerRing) {
- this.setOuterRing(outerRing);
- }
- @Override
- public List<Point> getCenterPoints(){
- return outerRing.getCenterPoints();
- }
- @Override
- public List<Point> getPoints() {
- List<Point> results = new ArrayList<Point>();
- for(Polygon pols : poligonos){
- results.addAll(pols.getPoints());
- }
- results.addAll(this.outerRing.getPoints());
- return results;
- }
- public List<Polygon> getPoligonos() {
- return poligonos;
- }
- public void setPoligonos(List<Polygon> poligonos) {
- this.poligonos = poligonos;
- }
- public Polygon getOuterRing() {
- return outerRing;
- }
- public void setOuterRing(Polygon outerRing) {
- this.outerRing = outerRing;
- }
-
- }