org.dmg.pmml.TrendExpoSmooth 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.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
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.Removed;
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>
* <group ref="{http://www.dmg.org/PMML-4_2}REAL-ARRAY" minOccurs="0"/>
* </sequence>
* <attribute name="trend" default="additive">
* <simpleType>
* <restriction base="{http://www.w3.org/2001/XMLSchema}NMTOKEN">
* <enumeration value="additive"/>
* <enumeration value="damped_additive"/>
* <enumeration value="multiplicative"/>
* <enumeration value="damped_multiplicative"/>
* <enumeration value="double_exponential"/>
* <enumeration value="polynomial_exponential"/>
* </restriction>
* </simpleType>
* </attribute>
* <attribute name="gamma" type="{http://www.dmg.org/PMML-4_2}REAL-NUMBER" />
* <attribute name="phi" type="{http://www.dmg.org/PMML-4_2}REAL-NUMBER" default="1" />
* <attribute name="smoothedValue" type="{http://www.dmg.org/PMML-4_2}REAL-NUMBER" />
* </restriction>
* </complexContent>
* </complexType>
*
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"array"
})
@Added(Version.PMML_4_0)
public class TrendExpoSmooth
extends PMMLObject
implements Locatable
{
@XmlElement(name = "Array")
protected Array array;
@XmlAttribute(name = "trend")
protected TrendExpoSmooth.Trend trend;
@XmlAttribute(name = "gamma")
protected Double gamma;
@XmlAttribute(name = "phi")
protected Double phi;
@XmlAttribute(name = "smoothedValue")
protected Double smoothedValue;
@XmlLocation
@XmlTransient
protected Locator locator;
/**
* Gets the value of the array property.
*
* @return
* possible object is
* {@link Array }
*
*/
public Array getArray() {
return array;
}
/**
* Sets the value of the array property.
*
* @param value
* allowed object is
* {@link Array }
*
*/
public void setArray(Array value) {
this.array = value;
}
/**
* Gets the value of the trend property.
*
* @return
* possible object is
* {@link TrendExpoSmooth.Trend }
*
*/
public TrendExpoSmooth.Trend getTrend() {
if (trend == null) {
return TrendExpoSmooth.Trend.ADDITIVE;
} else {
return trend;
}
}
/**
* Sets the value of the trend property.
*
* @param value
* allowed object is
* {@link TrendExpoSmooth.Trend }
*
*/
public void setTrend(TrendExpoSmooth.Trend value) {
this.trend = value;
}
/**
* Gets the value of the gamma property.
*
* @return
* possible object is
* {@link Double }
*
*/
public Double getGamma() {
return gamma;
}
/**
* Sets the value of the gamma property.
*
* @param value
* allowed object is
* {@link Double }
*
*/
public void setGamma(Double value) {
this.gamma = value;
}
/**
* Gets the value of the phi property.
*
* @return
* possible object is
* {@link Double }
*
*/
public double getPhi() {
if (phi == null) {
return 1.0D;
} else {
return phi;
}
}
/**
* Sets the value of the phi property.
*
* @param value
* allowed object is
* {@link Double }
*
*/
public void setPhi(Double value) {
this.phi = value;
}
/**
* Gets the value of the smoothedValue property.
*
* @return
* possible object is
* {@link Double }
*
*/
public Double getSmoothedValue() {
return smoothedValue;
}
/**
* Sets the value of the smoothedValue property.
*
* @param value
* allowed object is
* {@link Double }
*
*/
public void setSmoothedValue(Double value) {
this.smoothedValue = value;
}
public TrendExpoSmooth withArray(Array value) {
setArray(value);
return this;
}
public TrendExpoSmooth withTrend(TrendExpoSmooth.Trend value) {
setTrend(value);
return this;
}
public TrendExpoSmooth withGamma(Double value) {
setGamma(value);
return this;
}
public TrendExpoSmooth withPhi(Double value) {
setPhi(value);
return this;
}
public TrendExpoSmooth withSmoothedValue(Double value) {
setSmoothedValue(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.array!= null)) {
status = this.array.accept(visitor);
}
if (status == VisitorAction.TERMINATE) {
return VisitorAction.TERMINATE;
}
return VisitorAction.CONTINUE;
}
/**
* Java class for null.
*
*
The following schema fragment specifies the expected content contained within this class.
*
*
* <simpleType>
* <restriction base="{http://www.w3.org/2001/XMLSchema}NMTOKEN">
* <enumeration value="additive"/>
* <enumeration value="damped_additive"/>
* <enumeration value="multiplicative"/>
* <enumeration value="damped_multiplicative"/>
* <enumeration value="double_exponential"/>
* <enumeration value="polynomial_exponential"/>
* </restriction>
* </simpleType>
*
*
*/
@XmlType(name = "")
@XmlEnum
public enum Trend {
@XmlEnumValue("additive")
ADDITIVE("additive"),
@XmlEnumValue("damped_additive")
DAMPED_ADDITIVE("damped_additive"),
@XmlEnumValue("multiplicative")
MULTIPLICATIVE("multiplicative"),
@XmlEnumValue("damped_multiplicative")
DAMPED_MULTIPLICATIVE("damped_multiplicative"),
@XmlEnumValue("double_exponential")
@Removed(Version.PMML_4_1)
DOUBLE_EXPONENTIAL("double_exponential"),
@XmlEnumValue("polynomial_exponential")
@Added(Version.PMML_4_1)
POLYNOMIAL_EXPONENTIAL("polynomial_exponential");
private final String value;
Trend(String v) {
value = v;
}
public String value() {
return value;
}
public static TrendExpoSmooth.Trend fromValue(String v) {
for (TrendExpoSmooth.Trend c: TrendExpoSmooth.Trend.values()) {
if (c.value.equals(v)) {
return c;
}
}
throw new IllegalArgumentException(v);
}
}
}