001
002/*
003 * Copyright (C) 2010 Archie L. Cobbs. All rights reserved.
004 *
005 * $Id$
006 */
007
008package org.dellroad.jibxbindings.pidf.lo.gml;
009
010import java.net.URI;
011
012/**
013 * GML linear ring.
014 *
015 * This class assumes the nested element is {@code gml:posList}.
016 * The {@code <gml:pos>} and {@code <gml:pointProperty>} options are not supported.
017 */
018public class LinearRing extends Geometry {
019
020    private double[] posList;
021
022    public LinearRing() {
023    }
024
025    public LinearRing(String gid, URI srsName, int srsDimension, double[] posList) {
026        super(gid, srsName, srsDimension);
027        this.setPosList(posList);
028    }
029
030    /**
031     * The {@code posList} element.
032     */
033    public double[] getPosList() {
034        return this.posList;
035    }
036    public void setPosList(double[] posList) {
037        this.posList = posList;
038    }
039
040    @Override
041    public void visit(GMLObjectSwitch gmlObjectSwitch) {
042        gmlObjectSwitch.caseLinearRing(this);
043    }
044
045// Cloneable
046
047    @Override
048    public LinearRing clone() {
049        final LinearRing clone = (LinearRing)super.clone();
050        clone.posList = this.posList != null ? this.posList.clone() : null;
051        return clone;
052    }
053}
054