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 LineStrings. 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 LineString extends Curve { 019 020 private double[] posList; 021 022 public LineString() { 023 } 024 025 public LineString(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.caseLineString(this); 043 } 044 045// Cloneable 046 047 @Override 048 public LineString clone() { 049 final LineString clone = (LineString)super.clone(); 050 clone.posList = this.posList != null ? this.posList.clone() : null; 051 return clone; 052 } 053} 054