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


package de.micromata.opengis.kml.v_2_2_0;

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.XmlRootElement;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
import de.micromata.opengis.kml.v_2_2_0.annotations.Obvious;


/**
 *  and 
 * 

* If or 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 for examples. *

* * Syntax: *
<TimeSpan id="ID">
 *   <begin>...</begin>     <!-- kml:dateTime -->
 *   <end>...</end>         <!-- kml:dateTime -->
 * </TimeSpan>
* * Extends: * @see: * * Contained By: * @see: * * * */ @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 { /** * *

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

* * * */ protected String begin; /** * *

* 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; /** * *

* 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 = "TimeSpanObjectExtensionGroup") protected List timeSpanObjectExtension; public TimeSpan() { super(); } /** * @see begin * * @return * possible object is * {@link String} * */ public String getBegin() { return begin; } /** * @see begin * * @param value * allowed object is * {@link String} * */ public void setBegin(String value) { this.begin = value; } /** * @see end * * @return * possible object is * {@link String} * */ public String getEnd() { return end; } /** * @see end * * @param value * allowed object is * {@link String} * */ public void setEnd(String value) { this.end = value; } /** * @see timeSpanSimpleExtension * */ public List getTimeSpanSimpleExtension() { if (timeSpanSimpleExtension == null) { timeSpanSimpleExtension = new ArrayList(); } return this.timeSpanSimpleExtension; } /** * @see timeSpanObjectExtension * */ 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; } /** * @see timeSpanSimpleExtension * * @param timeSpanSimpleExtension */ 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; } /** * @see timeSpanObjectExtension * * @param timeSpanObjectExtension */ 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; } /** * @see objectSimpleExtension * */ @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; } /** * @see timePrimitiveSimpleExtension * */ @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; } /** * @see timePrimitiveObjectExtension * */ @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 * @see #setBegin(String) * * @param begin * required parameter */ public TimeSpan withBegin(final String begin) { this.setBegin(begin); return this; } /** * fluent setter * @see #setEnd(String) * * @param end * required parameter */ public TimeSpan withEnd(final String end) { this.setEnd(end); return this; } /** * fluent setter * @see #setTimeSpanSimpleExtension(List) * * @param timeSpanSimpleExtension * required parameter */ public TimeSpan withTimeSpanSimpleExtension(final List timeSpanSimpleExtension) { this.setTimeSpanSimpleExtension(timeSpanSimpleExtension); return this; } /** * fluent setter * @see #setTimeSpanObjectExtension(List) * * @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; } }