org.dmg.pmml.bayesian_network.Variance Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pmml-model-gwt Show documentation
Show all versions of pmml-model-gwt Show documentation
JPMML GWT compatible class model
package org.dmg.pmml.bayesian_network;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonRootName;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import jakarta.xml.bind.annotation.XmlElement;
import jakarta.xml.bind.annotation.XmlElements;
import jakarta.xml.bind.annotation.XmlRootElement;
import jakarta.xml.bind.annotation.XmlType;
import org.dmg.pmml.Expression;
import org.dmg.pmml.Extension;
import org.dmg.pmml.HasExtensions;
import org.dmg.pmml.Visitor;
import org.dmg.pmml.VisitorAction;
import org.jpmml.model.MissingElementException;
import org.jpmml.model.annotations.Added;
import org.jpmml.model.annotations.ValueConstructor;
@XmlRootElement(name = "Variance", namespace = "http://www.dmg.org/PMML-4_4")
@XmlType(name = "", propOrder = {
"extensions",
"expression"
})
@JsonRootName("Variance")
@JsonPropertyOrder({
"extensions",
"expression"
})
@Added((org.dmg.pmml.Version.PMML_4_3))
public class Variance
extends org.dmg.pmml.PMMLObject
implements HasExtensions
{
@XmlElement(name = "Extension", namespace = "http://www.dmg.org/PMML-4_4")
@JsonProperty("Extension")
private List extensions;
@XmlElements({
@XmlElement(name = "Constant", namespace = "http://www.dmg.org/PMML-4_4", type = org.dmg.pmml.Constant.class),
@XmlElement(name = "FieldRef", namespace = "http://www.dmg.org/PMML-4_4", type = org.dmg.pmml.FieldRef.class),
@XmlElement(name = "NormContinuous", namespace = "http://www.dmg.org/PMML-4_4", type = org.dmg.pmml.NormContinuous.class),
@XmlElement(name = "NormDiscrete", namespace = "http://www.dmg.org/PMML-4_4", type = org.dmg.pmml.NormDiscrete.class),
@XmlElement(name = "Discretize", namespace = "http://www.dmg.org/PMML-4_4", type = org.dmg.pmml.Discretize.class),
@XmlElement(name = "MapValues", namespace = "http://www.dmg.org/PMML-4_4", type = org.dmg.pmml.MapValues.class),
@XmlElement(name = "TextIndex", namespace = "http://www.dmg.org/PMML-4_4", type = org.dmg.pmml.TextIndex.class),
@XmlElement(name = "Apply", namespace = "http://www.dmg.org/PMML-4_4", type = org.dmg.pmml.Apply.class),
@XmlElement(name = "Aggregate", namespace = "http://www.dmg.org/PMML-4_4", type = org.dmg.pmml.Aggregate.class),
@XmlElement(name = "Lag", namespace = "http://www.dmg.org/PMML-4_4", type = org.dmg.pmml.Lag.class)
})
@JsonProperty("Expression")
@JsonTypeInfo(include = JsonTypeInfo.As.WRAPPER_OBJECT, use = JsonTypeInfo.Id.NAME)
@JsonSubTypes({
@JsonSubTypes.Type(name = "Constant", value = org.dmg.pmml.Constant.class),
@JsonSubTypes.Type(name = "FieldRef", value = org.dmg.pmml.FieldRef.class),
@JsonSubTypes.Type(name = "NormContinuous", value = org.dmg.pmml.NormContinuous.class),
@JsonSubTypes.Type(name = "NormDiscrete", value = org.dmg.pmml.NormDiscrete.class),
@JsonSubTypes.Type(name = "Discretize", value = org.dmg.pmml.Discretize.class),
@JsonSubTypes.Type(name = "MapValues", value = org.dmg.pmml.MapValues.class),
@JsonSubTypes.Type(name = "TextIndex", value = org.dmg.pmml.TextIndex.class),
@JsonSubTypes.Type(name = "Apply", value = org.dmg.pmml.Apply.class),
@JsonSubTypes.Type(name = "Aggregate", value = org.dmg.pmml.Aggregate.class),
@JsonSubTypes.Type(name = "Lag", value = org.dmg.pmml.Lag.class)
})
private Expression expression;
private final static long serialVersionUID = 67371270L;
public Variance() {
}
@ValueConstructor
public Variance(
@org.jpmml.model.annotations.Property("expression")
Expression expression) {
this.expression = expression;
}
@Override
public boolean hasExtensions() {
return ((this.extensions!= null)&&(!this.extensions.isEmpty()));
}
@Override
public List getExtensions() {
if (extensions == null) {
extensions = new ArrayList();
}
return this.extensions;
}
@Override
public Variance addExtensions(Extension... extensions) {
getExtensions().addAll(Arrays.asList(extensions));
return this;
}
public Expression requireExpression() {
if (this.expression == null) {
throw new MissingElementException(this, PMMLElements.VARIANCE_EXPRESSION);
}
return this.expression;
}
public Expression getExpression() {
return expression;
}
public Variance setExpression(
@org.jpmml.model.annotations.Property("expression")
Expression expression) {
this.expression = expression;
return this;
}
@Override
public VisitorAction accept(Visitor visitor) {
VisitorAction status = visitor.visit(this);
if (status == VisitorAction.CONTINUE) {
visitor.pushParent(this);
if ((status == VisitorAction.CONTINUE)&&hasExtensions()) {
status = org.dmg.pmml.PMMLObject.traverse(visitor, getExtensions());
}
if (status == VisitorAction.CONTINUE) {
status = org.dmg.pmml.PMMLObject.traverse(visitor, getExpression());
}
visitor.popParent();
}
if (status == VisitorAction.TERMINATE) {
return VisitorAction.TERMINATE;
}
return VisitorAction.CONTINUE;
}
}