All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.dmg.pmml.AnovaRow Maven / Gradle / Ivy

There is a newer version: 1.6.5
Show newest version

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.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
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.dmg.pmml.adapters.ProbabilityNumberAdapter;
import org.jpmml.model.annotations.Added;
import org.jpmml.model.annotations.ValueConstructor;

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
    "extensions"
})
@XmlRootElement(name = "AnovaRow", namespace = "http://www.dmg.org/PMML-4_3")
@Added((org.dmg.pmml.Version.PMML_4_0))
@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY, getterVisibility = JsonAutoDetect.Visibility.NONE, isGetterVisibility = JsonAutoDetect.Visibility.NONE, setterVisibility = JsonAutoDetect.Visibility.NONE)
@JsonInclude(JsonInclude.Include.NON_EMPTY)
@JsonPropertyOrder({
    "type",
    "sumOfSquares",
    "degreesOfFreedom",
    "meanOfSquares",
    "fValue",
    "pValue",
    "extensions"
})
public class AnovaRow
    extends org.dmg.pmml.PMMLObject
    implements HasExtensions
{

    @XmlAttribute(name = "type", required = true)
    @JsonProperty("type")
    private AnovaRow.Type type;
    @XmlAttribute(name = "sumOfSquares", required = true)
    @XmlJavaTypeAdapter(NumberAdapter.class)
    @JsonProperty("sumOfSquares")
    private Number sumOfSquares;
    @XmlAttribute(name = "degreesOfFreedom", required = true)
    @XmlJavaTypeAdapter(NumberAdapter.class)
    @JsonProperty("degreesOfFreedom")
    private Number degreesOfFreedom;
    @XmlAttribute(name = "meanOfSquares")
    @XmlJavaTypeAdapter(NumberAdapter.class)
    @JsonProperty("meanOfSquares")
    private Number meanOfSquares;
    @XmlAttribute(name = "fValue")
    @XmlJavaTypeAdapter(NumberAdapter.class)
    @JsonProperty("fValue")
    private Number fValue;
    @XmlAttribute(name = "pValue")
    @XmlJavaTypeAdapter(ProbabilityNumberAdapter.class)
    @JsonProperty("pValue")
    private Number pValue;
    @XmlElement(name = "Extension", namespace = "http://www.dmg.org/PMML-4_3")
    @JsonProperty("Extension")
    private List extensions;
    private final static long serialVersionUID = 67305489L;

    public AnovaRow() {
    }

    @ValueConstructor
    public AnovaRow(
        @org.jpmml.model.annotations.Property("type")
        AnovaRow.Type type,
        @org.jpmml.model.annotations.Property("sumOfSquares")
        Number sumOfSquares,
        @org.jpmml.model.annotations.Property("degreesOfFreedom")
        Number degreesOfFreedom) {
        this.type = type;
        this.sumOfSquares = sumOfSquares;
        this.degreesOfFreedom = degreesOfFreedom;
    }

    public AnovaRow.Type getType() {
        return type;
    }

    public AnovaRow setType(
        @org.jpmml.model.annotations.Property("type")
        AnovaRow.Type type) {
        this.type = type;
        return this;
    }

    public Number getSumOfSquares() {
        return sumOfSquares;
    }

    public AnovaRow setSumOfSquares(
        @org.jpmml.model.annotations.Property("sumOfSquares")
        Number sumOfSquares) {
        this.sumOfSquares = sumOfSquares;
        return this;
    }

    public Number getDegreesOfFreedom() {
        return degreesOfFreedom;
    }

    public AnovaRow setDegreesOfFreedom(
        @org.jpmml.model.annotations.Property("degreesOfFreedom")
        Number degreesOfFreedom) {
        this.degreesOfFreedom = degreesOfFreedom;
        return this;
    }

    public Number getMeanOfSquares() {
        return meanOfSquares;
    }

    public AnovaRow setMeanOfSquares(
        @org.jpmml.model.annotations.Property("meanOfSquares")
        Number meanOfSquares) {
        this.meanOfSquares = meanOfSquares;
        return this;
    }

    public Number getFValue() {
        return fValue;
    }

    public AnovaRow setFValue(
        @org.jpmml.model.annotations.Property("fValue")
        Number fValue) {
        this.fValue = fValue;
        return this;
    }

    public Number getPValue() {
        return pValue;
    }

    public AnovaRow setPValue(
        @org.jpmml.model.annotations.Property("pValue")
        Number pValue) {
        this.pValue = pValue;
        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 AnovaRow addExtensions(Extension... extensions) {
        getExtensions().addAll(Arrays.asList(extensions));
        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());
            }
            visitor.popParent();
        }
        if (status == VisitorAction.TERMINATE) {
            return VisitorAction.TERMINATE;
        }
        return VisitorAction.CONTINUE;
    }

    @XmlType(name = "")
    @XmlEnum
    public enum Type
        implements StringValue
    {

        @XmlEnumValue("Model")
        @JsonProperty("Model")
        MODEL("Model"),
        @XmlEnumValue("Error")
        @JsonProperty("Error")
        ERROR("Error"),
        @XmlEnumValue("Total")
        @JsonProperty("Total")
        TOTAL("Total");
        private final String value;

        Type(String v) {
            value = v;
        }

        @Override
        public String value() {
            return value;
        }

        public static AnovaRow.Type fromValue(String v) {
            for (AnovaRow.Type c: AnovaRow.Type.values()) {
                if (c.value.equals(v)) {
                    return c;
                }
            }
            throw new IllegalArgumentException(v);
        }

        @Override
        public String toString() {
            return value();
        }

    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy