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

de.micromata.opengis.kml.v_2_2_0.TimeSpan 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 jakarta.xml.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;


/**
 * {@code } and {@code }
 * 

* If {@code } or {@code } is missing, then that end of the period is unbounded (see Example * below). *

*

* Represents an extent in time bounded by begin and end dateTimes. *

*

* The dateTime is defined according to XML Schema time (see XML Schema Part 2: Datatypes * Second Edition). The value can be expressed as yyyy-mm-ddThh:mm:sszzzzzz, where * T is the separator between the date and the time, and the time zone is either Z * (for UTC) or zzzzzz, which represents ±hh:mm in relation to UTC. Additionally, the * value can be expressed as a date only. See {@code } for examples. *

* * Syntax: *
<TimeSpan id="ID">
 *   <begin>...</begin>     <!-- kml:dateTime -->
 *   <end>...</end>         <!-- kml:dateTime -->
 * </TimeSpan>
* * Extends: * * * Contained By: * * * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "TimeSpanType", propOrder = { "begin", "end", "timeSpanSimpleExtension", "timeSpanObjectExtension" }) @XmlRootElement(name = "TimeSpan", namespace = "http://www.opengis.net/kml/2.2") public class TimeSpan extends TimePrimitive implements Cloneable { /** * {@code } *

* Describes the beginning instant of a time period. If absent, the beginning of the * period is unbounded. *

* * * */ protected String begin; /** * {@code } *

* Describes the ending instant of a time period. If absent, the end of the period * is unbounded. *

* * * */ protected String end; @XmlElement(name = "TimeSpanSimpleExtensionGroup") @XmlSchemaType(name = "anySimpleType") protected List timeSpanSimpleExtension; /** * {@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 = "TimeSpanObjectExtensionGroup") protected List timeSpanObjectExtension; public TimeSpan() { super(); } /** * * * @return * possible object is * {@link String} * */ public String getBegin() { return begin; } /** * * * @param value * allowed object is * {@link String} * */ public void setBegin(String value) { this.begin = value; } /** * * * @return * possible object is * {@link String} * */ public String getEnd() { return end; } /** * * * @param value * allowed object is * {@link String} * */ public void setEnd(String value) { this.end = value; } /** * * */ public List getTimeSpanSimpleExtension() { if (timeSpanSimpleExtension == null) { timeSpanSimpleExtension = new ArrayList(); } return this.timeSpanSimpleExtension; } /** * * */ public List getTimeSpanObjectExtension() { if (timeSpanObjectExtension == null) { timeSpanObjectExtension = new ArrayList(); } return this.timeSpanObjectExtension; } @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = ((prime*result)+((begin == null)? 0 :begin.hashCode())); result = ((prime*result)+((end == null)? 0 :end.hashCode())); result = ((prime*result)+((timeSpanSimpleExtension == null)? 0 :timeSpanSimpleExtension.hashCode())); result = ((prime*result)+((timeSpanObjectExtension == null)? 0 :timeSpanObjectExtension.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 TimeSpan) == false) { return false; } TimeSpan other = ((TimeSpan) obj); if (begin == null) { if (other.begin!= null) { return false; } } else { if (begin.equals(other.begin) == false) { return false; } } if (end == null) { if (other.end!= null) { return false; } } else { if (end.equals(other.end) == false) { return false; } } if (timeSpanSimpleExtension == null) { if (other.timeSpanSimpleExtension!= null) { return false; } } else { if (timeSpanSimpleExtension.equals(other.timeSpanSimpleExtension) == false) { return false; } } if (timeSpanObjectExtension == null) { if (other.timeSpanObjectExtension!= null) { return false; } } else { if (timeSpanObjectExtension.equals(other.timeSpanObjectExtension) == false) { return false; } } return true; } /** * * * @param timeSpanSimpleExtension * Objects of the following type are allowed in the list: {@link Object} */ public void setTimeSpanSimpleExtension(final List timeSpanSimpleExtension) { this.timeSpanSimpleExtension = timeSpanSimpleExtension; } /** * add a value to the timeSpanSimpleExtension property collection * * @param timeSpanSimpleExtension * Objects of the following type are allowed in the list: {@link Object} * @return * true (as general contract of Collection.add). */ public TimeSpan addToTimeSpanSimpleExtension(final Object timeSpanSimpleExtension) { this.getTimeSpanSimpleExtension().add(timeSpanSimpleExtension); return this; } /** * * * @param timeSpanObjectExtension * Objects of the following type are allowed in the list: {@link AbstractObject} */ public void setTimeSpanObjectExtension(final List timeSpanObjectExtension) { this.timeSpanObjectExtension = timeSpanObjectExtension; } /** * add a value to the timeSpanObjectExtension property collection * * @param timeSpanObjectExtension * Objects of the following type are allowed in the list: {@link AbstractObject} * @return * true (as general contract of Collection.add). */ public TimeSpan addToTimeSpanObjectExtension(final AbstractObject timeSpanObjectExtension) { this.getTimeSpanObjectExtension().add(timeSpanObjectExtension); return this; } /** * * */ @Obvious @Override public void setObjectSimpleExtension(final List objectSimpleExtension) { super.setObjectSimpleExtension(objectSimpleExtension); } @Obvious @Override public TimeSpan addToObjectSimpleExtension(final Object objectSimpleExtension) { super.getObjectSimpleExtension().add(objectSimpleExtension); return this; } /** * * */ @Obvious @Override public void setTimePrimitiveSimpleExtension(final List timePrimitiveSimpleExtension) { super.setTimePrimitiveSimpleExtension(timePrimitiveSimpleExtension); } @Obvious @Override public TimeSpan addToTimePrimitiveSimpleExtension(final Object timePrimitiveSimpleExtension) { super.getTimePrimitiveSimpleExtension().add(timePrimitiveSimpleExtension); return this; } /** * * */ @Obvious @Override public void setTimePrimitiveObjectExtension(final List timePrimitiveObjectExtension) { super.setTimePrimitiveObjectExtension(timePrimitiveObjectExtension); } @Obvious @Override public TimeSpan addToTimePrimitiveObjectExtension(final AbstractObject timePrimitiveObjectExtension) { super.getTimePrimitiveObjectExtension().add(timePrimitiveObjectExtension); return this; } /** * fluent setter * * * @param begin * required parameter */ public TimeSpan withBegin(final String begin) { this.setBegin(begin); return this; } /** * fluent setter * * * @param end * required parameter */ public TimeSpan withEnd(final String end) { this.setEnd(end); return this; } /** * fluent setter * * * @param timeSpanSimpleExtension * required parameter */ public TimeSpan withTimeSpanSimpleExtension(final List timeSpanSimpleExtension) { this.setTimeSpanSimpleExtension(timeSpanSimpleExtension); return this; } /** * fluent setter * * * @param timeSpanObjectExtension * required parameter */ public TimeSpan withTimeSpanObjectExtension(final List timeSpanObjectExtension) { this.setTimeSpanObjectExtension(timeSpanObjectExtension); return this; } @Obvious @Override public TimeSpan withObjectSimpleExtension(final List objectSimpleExtension) { super.withObjectSimpleExtension(objectSimpleExtension); return this; } @Obvious @Override public TimeSpan withId(final String id) { super.withId(id); return this; } @Obvious @Override public TimeSpan withTargetId(final String targetId) { super.withTargetId(targetId); return this; } @Obvious @Override public TimeSpan withTimePrimitiveSimpleExtension(final List timePrimitiveSimpleExtension) { super.withTimePrimitiveSimpleExtension(timePrimitiveSimpleExtension); return this; } @Obvious @Override public TimeSpan withTimePrimitiveObjectExtension(final List timePrimitiveObjectExtension) { super.withTimePrimitiveObjectExtension(timePrimitiveObjectExtension); return this; } @Override public TimeSpan clone() { TimeSpan copy; copy = ((TimeSpan) super.clone()); copy.timeSpanSimpleExtension = new ArrayList((getTimeSpanSimpleExtension().size())); for (Object iter: timeSpanSimpleExtension) { copy.timeSpanSimpleExtension.add(iter); } copy.timeSpanObjectExtension = new ArrayList((getTimeSpanObjectExtension().size())); for (AbstractObject iter: timeSpanObjectExtension) { copy.timeSpanObjectExtension.add(iter.clone()); } return copy; } }