org.dmg.pmml.TimeValue Maven / Gradle / Ivy
package org.dmg.pmml;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;
import com.sun.xml.bind.Locatable;
import com.sun.xml.bind.annotation.XmlLocation;
import org.jpmml.schema.Added;
import org.jpmml.schema.Version;
import org.xml.sax.Locator;
/**
* Java class for anonymous complex type.
*
*
The following schema fragment specifies the expected content contained within this class.
*
*
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element ref="{http://www.dmg.org/PMML-4_2}Timestamp" minOccurs="0"/>
* </sequence>
* <attribute name="index" type="{http://www.dmg.org/PMML-4_2}INT-NUMBER" />
* <attribute name="time" type="{http://www.dmg.org/PMML-4_2}NUMBER" />
* <attribute name="value" use="required" type="{http://www.dmg.org/PMML-4_2}REAL-NUMBER" />
* <attribute name="standardError" type="{http://www.dmg.org/PMML-4_2}REAL-NUMBER" />
* </restriction>
* </complexContent>
* </complexType>
*
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"timestamp"
})
@XmlRootElement(name = "TimeValue")
@Added(Version.PMML_4_0)
public class TimeValue
extends PMMLObject
implements Locatable
{
@XmlElement(name = "Timestamp")
protected Timestamp timestamp;
@XmlAttribute(name = "index")
protected Integer index;
@XmlAttribute(name = "time")
protected Double time;
@XmlAttribute(name = "value", required = true)
protected double value;
@XmlAttribute(name = "standardError")
protected Double standardError;
@XmlLocation
@XmlTransient
protected Locator locator;
public TimeValue() {
super();
}
public TimeValue(final double value) {
super();
this.value = value;
}
/**
* Gets the value of the timestamp property.
*
* @return
* possible object is
* {@link Timestamp }
*
*/
public Timestamp getTimestamp() {
return timestamp;
}
/**
* Sets the value of the timestamp property.
*
* @param value
* allowed object is
* {@link Timestamp }
*
*/
public void setTimestamp(Timestamp value) {
this.timestamp = value;
}
/**
* Gets the value of the index property.
*
* @return
* possible object is
* {@link Integer }
*
*/
public Integer getIndex() {
return index;
}
/**
* Sets the value of the index property.
*
* @param value
* allowed object is
* {@link Integer }
*
*/
public void setIndex(Integer value) {
this.index = value;
}
/**
* Gets the value of the time property.
*
* @return
* possible object is
* {@link Double }
*
*/
public Double getTime() {
return time;
}
/**
* Sets the value of the time property.
*
* @param value
* allowed object is
* {@link Double }
*
*/
public void setTime(Double value) {
this.time = value;
}
/**
* Gets the value of the value property.
*
*/
public double getValue() {
return value;
}
/**
* Sets the value of the value property.
*
*/
public void setValue(double value) {
this.value = value;
}
/**
* Gets the value of the standardError property.
*
* @return
* possible object is
* {@link Double }
*
*/
public Double getStandardError() {
return standardError;
}
/**
* Sets the value of the standardError property.
*
* @param value
* allowed object is
* {@link Double }
*
*/
public void setStandardError(Double value) {
this.standardError = value;
}
public TimeValue withTimestamp(Timestamp value) {
setTimestamp(value);
return this;
}
public TimeValue withIndex(Integer value) {
setIndex(value);
return this;
}
public TimeValue withTime(Double value) {
setTime(value);
return this;
}
public TimeValue withValue(double value) {
setValue(value);
return this;
}
public TimeValue withStandardError(Double value) {
setStandardError(value);
return this;
}
public Locator sourceLocation() {
return locator;
}
public void setSourceLocation(Locator newLocator) {
locator = newLocator;
}
@Override
public VisitorAction accept(Visitor visitor) {
VisitorAction status = visitor.visit(this);
if ((status == VisitorAction.CONTINUE)&&(this.timestamp!= null)) {
status = this.timestamp.accept(visitor);
}
if (status == VisitorAction.TERMINATE) {
return VisitorAction.TERMINATE;
}
return VisitorAction.CONTINUE;
}
}