All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.micromata.opengis.kml.v_2_2_0.Geometry Maven / Gradle / Ivy


package de.micromata.opengis.kml.v_2_2_0;

import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementRef;
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.bind.annotation.XmlType;
import de.micromata.opengis.kml.v_2_2_0.annotations.Obvious;
import de.micromata.opengis.kml.v_2_2_0.gx.MultiTrack;
import de.micromata.opengis.kml.v_2_2_0.gx.Track;


/**
 * 
 * 

* This is an abstract element and cannot be used directly in a KML file. It provides * a placeholder object for all derived Geometry objects. *

* * Syntax: *
<!-- abstract element; do not create -->
 * <!-- Geometry id="ID" -->                 <!-- Point,LineString,LinearRing,
 *                                                Polygon,MultiGeometry,Model -->
 * <!-- /Geometry -->
* * Extends: * @see: * * Extended By: * @see: * @see: * @see: * @see: * @see: MultiGeometry * @see: Polygon * * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "AbstractGeometryType", propOrder = { "geometrySimpleExtension", "geometryObjectExtension" }) @XmlSeeAlso({ MultiTrack.class, Track.class, LinearRing.class, Point.class, Model.class, MultiGeometry.class, LineString.class, Polygon.class }) public abstract class Geometry extends AbstractObject implements Cloneable { /** * *

* This is an abstract base class and cannot be used directly in a KML file. It provides * the id attribute, which allows unique identification of a KML element, and the targetId * attribute, which is used to reference objects that have already been loaded into * Google Earth. The id attribute must be assigned if the mechanism is to * be used. *

* * Syntax: *
<!-- abstract element; do not create -->
     * <!-- Object id="ID" targetId="NCName" -->
     * <!-- /Object> -->
* * * */ @XmlElement(name = "AbstractGeometrySimpleExtensionGroup") protected List geometrySimpleExtension; /** * *

* This is an abstract base class and cannot be used directly in a KML file. It provides * the id attribute, which allows unique identification of a KML element, and the targetId * attribute, which is used to reference objects that have already been loaded into * Google Earth. The id attribute must be assigned if the mechanism is to * be used. *

* * Syntax: *
<!-- abstract element; do not create -->
     * <!-- Object id="ID" targetId="NCName" -->
     * <!-- /Object> -->
* * * */ @XmlElement(name = "AbstractGeometryObjectExtensionGroup") protected List geometryObjectExtension; public Geometry() { super(); } /** * @see geometrySimpleExtension * */ public List getGeometrySimpleExtension() { if (geometrySimpleExtension == null) { geometrySimpleExtension = new ArrayList(); } return this.geometrySimpleExtension; } /** * @see geometryObjectExtension * */ public List getGeometryObjectExtension() { if (geometryObjectExtension == null) { geometryObjectExtension = new ArrayList(); } return this.geometryObjectExtension; } @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = ((prime*result)+((geometrySimpleExtension == null)? 0 :geometrySimpleExtension.hashCode())); result = ((prime*result)+((geometryObjectExtension == null)? 0 :geometryObjectExtension.hashCode())); return result; } @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (super.equals(obj) == false) { return false; } if ((obj instanceof Geometry) == false) { return false; } Geometry other = ((Geometry) obj); if (geometrySimpleExtension == null) { if (other.geometrySimpleExtension!= null) { return false; } } else { if (geometrySimpleExtension.equals(other.geometrySimpleExtension) == false) { return false; } } if (geometryObjectExtension == null) { if (other.geometryObjectExtension!= null) { return false; } } else { if (geometryObjectExtension.equals(other.geometryObjectExtension) == false) { return false; } } return true; } /** * @see geometrySimpleExtension * * @param geometrySimpleExtension */ public void setGeometrySimpleExtension(final List geometrySimpleExtension) { this.geometrySimpleExtension = geometrySimpleExtension; } /** * add a value to the geometrySimpleExtension property collection * * @param geometrySimpleExtension * Objects of the following type are allowed in the list: {@code <}{@link Object}{@code>}{@link JAXBElement}{@code <}{@link BigInteger}{@code>}{@link JAXBElement}{@code <}{@link Double}{@code>} * @return * true (as general contract of Collection.add). */ public Geometry addToGeometrySimpleExtension(final Object geometrySimpleExtension) { this.getGeometrySimpleExtension().add(geometrySimpleExtension); return this; } /** * @see geometryObjectExtension * * @param geometryObjectExtension */ public void setGeometryObjectExtension(final List geometryObjectExtension) { this.geometryObjectExtension = geometryObjectExtension; } /** * add a value to the geometryObjectExtension property collection * * @param geometryObjectExtension * Objects of the following type are allowed in the list: {@link AbstractObject} * @return * true (as general contract of Collection.add). */ public Geometry addToGeometryObjectExtension(final AbstractObject geometryObjectExtension) { this.getGeometryObjectExtension().add(geometryObjectExtension); return this; } /** * @see objectSimpleExtension * */ @Obvious @Override public void setObjectSimpleExtension(final List objectSimpleExtension) { super.setObjectSimpleExtension(objectSimpleExtension); } @Obvious @Override public Geometry addToObjectSimpleExtension(final Object objectSimpleExtension) { super.getObjectSimpleExtension().add(objectSimpleExtension); return this; } /** * fluent setter * @see #setGeometrySimpleExtension(List) * * @param geometrySimpleExtension * required parameter */ public Geometry withGeometrySimpleExtension(final List geometrySimpleExtension) { this.setGeometrySimpleExtension(geometrySimpleExtension); return this; } /** * fluent setter * @see #setGeometryObjectExtension(List) * * @param geometryObjectExtension * required parameter */ public Geometry withGeometryObjectExtension(final List geometryObjectExtension) { this.setGeometryObjectExtension(geometryObjectExtension); return this; } @Obvious @Override public Geometry withObjectSimpleExtension(final List objectSimpleExtension) { super.withObjectSimpleExtension(objectSimpleExtension); return this; } @Obvious @Override public Geometry withId(final String id) { super.withId(id); return this; } @Obvious @Override public Geometry withTargetId(final String targetId) { super.withTargetId(targetId); return this; } @Override public Geometry clone() { Geometry copy; copy = ((Geometry) super.clone()); copy.geometrySimpleExtension = new ArrayList((getGeometrySimpleExtension().size())); for (Object iter: geometrySimpleExtension) { copy.geometrySimpleExtension.add(iter); } copy.geometryObjectExtension = new ArrayList((getGeometryObjectExtension().size())); for (AbstractObject iter: geometryObjectExtension) { copy.geometryObjectExtension.add(iter.clone()); } return copy; } }