org.dmg.pmml.NumericInfo Maven / Gradle / Ivy
package org.dmg.pmml;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
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.XmlType;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import org.dmg.pmml.adapters.NumberAdapter;
import org.jpmml.model.annotations.Property;
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"extensions",
"quantiles"
})
@XmlRootElement(name = "NumericInfo", namespace = "http://www.dmg.org/PMML-4_3")
@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY, getterVisibility = JsonAutoDetect.Visibility.NONE, isGetterVisibility = JsonAutoDetect.Visibility.NONE, setterVisibility = JsonAutoDetect.Visibility.NONE)
@JsonInclude(JsonInclude.Include.NON_EMPTY)
@JsonPropertyOrder({
"minimum",
"maximum",
"mean",
"standardDeviation",
"median",
"interQuartileRange",
"extensions",
"quantiles"
})
public class NumericInfo
extends org.dmg.pmml.PMMLObject
implements HasExtensions
{
@XmlAttribute(name = "minimum")
@XmlJavaTypeAdapter(NumberAdapter.class)
@JsonProperty("minimum")
private Number minimum;
@XmlAttribute(name = "maximum")
@XmlJavaTypeAdapter(NumberAdapter.class)
@JsonProperty("maximum")
private Number maximum;
@XmlAttribute(name = "mean")
@XmlJavaTypeAdapter(NumberAdapter.class)
@JsonProperty("mean")
private Number mean;
@XmlAttribute(name = "standardDeviation")
@XmlJavaTypeAdapter(NumberAdapter.class)
@JsonProperty("standardDeviation")
private Number standardDeviation;
@XmlAttribute(name = "median")
@XmlJavaTypeAdapter(NumberAdapter.class)
@JsonProperty("median")
private Number median;
@XmlAttribute(name = "interQuartileRange")
@XmlJavaTypeAdapter(NumberAdapter.class)
@JsonProperty("interQuartileRange")
private Number interQuartileRange;
@XmlElement(name = "Extension", namespace = "http://www.dmg.org/PMML-4_3")
@JsonProperty("Extension")
private List extensions;
@XmlElement(name = "Quantile", namespace = "http://www.dmg.org/PMML-4_3")
@JsonProperty("Quantile")
private List quantiles;
private final static long serialVersionUID = 67305489L;
public Number getMinimum() {
return minimum;
}
public NumericInfo setMinimum(
@Property("minimum")
Number minimum) {
this.minimum = minimum;
return this;
}
public Number getMaximum() {
return maximum;
}
public NumericInfo setMaximum(
@Property("maximum")
Number maximum) {
this.maximum = maximum;
return this;
}
public Number getMean() {
return mean;
}
public NumericInfo setMean(
@Property("mean")
Number mean) {
this.mean = mean;
return this;
}
public Number getStandardDeviation() {
return standardDeviation;
}
public NumericInfo setStandardDeviation(
@Property("standardDeviation")
Number standardDeviation) {
this.standardDeviation = standardDeviation;
return this;
}
public Number getMedian() {
return median;
}
public NumericInfo setMedian(
@Property("median")
Number median) {
this.median = median;
return this;
}
public Number getInterQuartileRange() {
return interQuartileRange;
}
public NumericInfo setInterQuartileRange(
@Property("interQuartileRange")
Number interQuartileRange) {
this.interQuartileRange = interQuartileRange;
return this;
}
@Override
public boolean hasExtensions() {
return ((this.extensions!= null)&&(this.extensions.size()> 0));
}
@Override
public List getExtensions() {
if (extensions == null) {
extensions = new ArrayList();
}
return this.extensions;
}
@Override
public NumericInfo addExtensions(Extension... extensions) {
getExtensions().addAll(Arrays.asList(extensions));
return this;
}
public boolean hasQuantiles() {
return ((this.quantiles!= null)&&(this.quantiles.size()> 0));
}
public List getQuantiles() {
if (quantiles == null) {
quantiles = new ArrayList();
}
return this.quantiles;
}
public NumericInfo addQuantiles(Quantile... quantiles) {
getQuantiles().addAll(Arrays.asList(quantiles));
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)&&hasQuantiles()) {
status = org.dmg.pmml.PMMLObject.traverse(visitor, getQuantiles());
}
visitor.popParent();
}
if (status == VisitorAction.TERMINATE) {
return VisitorAction.TERMINATE;
}
return VisitorAction.CONTINUE;
}
}