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

Go to download

This is JavaAPIforKMml, Micromata's library for use with applications that want to parse, generate and operate on KML. It is an implementation of the OGC KML 2.2 standard. It is written entirely in Java and makes heavy use of JAXB.

There is a newer version: 3.0.4
Show newest version

package de.micromata.opengis.kml.v_2_2_0;

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;
import jakarta.xml.bind.annotation.*;

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


/**
 * {@code }
 * 

* 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: * * * Extended By: * * * * * * * * * */ @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 { /** * {@code } *

* 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 Update mechanism is to * be used. *

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

* 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 Update 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(); } /** * * */ public List getGeometrySimpleExtension() { if (geometrySimpleExtension == null) { geometrySimpleExtension = new ArrayList(); } return this.geometrySimpleExtension; } /** * * */ 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; } /** * * * @param geometrySimpleExtension * Objects of the following type are allowed in the list: {@code <}{@link Object}{@code >}{@code <}{@link BigInteger}{@code >}{@code <}{@link Double}{@code >} */ 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 >}{@code <}{@link BigInteger}{@code >}{@code <}{@link Double}{@code >} * @return * true (as general contract of Collection.add). */ public Geometry addToGeometrySimpleExtension(final Object geometrySimpleExtension) { this.getGeometrySimpleExtension().add(geometrySimpleExtension); return this; } /** * * * @param geometryObjectExtension * Objects of the following type are allowed in the list: {@link AbstractObject} */ 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; } /** * * */ @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 * * * @param geometrySimpleExtension * required parameter */ public Geometry withGeometrySimpleExtension(final List geometrySimpleExtension) { this.setGeometrySimpleExtension(geometrySimpleExtension); return this; } /** * fluent setter * * * @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; } }