org.dmg.pmml.PCovMatrix Maven / Gradle / Ivy
Show all versions of pmml-model-gwt Show documentation
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 org.jpmml.schema.Added;
import org.jpmml.schema.Version;
/**
* 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}Extension" maxOccurs="unbounded" minOccurs="0"/>
* <element ref="{http://www.dmg.org/PMML-4_2}PCovCell" maxOccurs="unbounded"/>
* </sequence>
* <attribute name="type">
* <simpleType>
* <restriction base="{http://www.w3.org/2001/XMLSchema}string">
* <enumeration value="model"/>
* <enumeration value="robust"/>
* </restriction>
* </simpleType>
* </attribute>
* </restriction>
* </complexContent>
* </complexType>
*
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"extensions",
"pCovCells"
})
@XmlRootElement(name = "PCovMatrix", namespace = "http://www.dmg.org/PMML-4_2")
public class PCovMatrix
extends org.dmg.pmml.PMMLObject
implements HasExtensions
{
@XmlAttribute(name = "type")
@Added(Version.PMML_3_2)
private PCovMatrix.Type type;
@XmlElement(name = "Extension", namespace = "http://www.dmg.org/PMML-4_2")
private List extensions;
@XmlElement(name = "PCovCell", namespace = "http://www.dmg.org/PMML-4_2", required = true)
private List pCovCells;
public PCovMatrix() {
super();
}
public PCovMatrix(final List pCovCells) {
super();
this.pCovCells = pCovCells;
}
/**
* Gets the value of the type property.
*
* @return
* possible object is
* {@link PCovMatrix.Type }
*
*/
public PCovMatrix.Type getType() {
return type;
}
/**
* Sets the value of the type property.
*
* @param type
* allowed object is
* {@link PCovMatrix.Type }
*
*/
public PCovMatrix setType(PCovMatrix.Type type) {
this.type = type;
return this;
}
/**
* Gets the value of the extensions property.
*
*
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a set
method for the extensions property.
*
*
* For example, to add a new item, do as follows:
*
* getExtensions().add(newItem);
*
*
*
*
* Objects of the following type(s) are allowed in the list
* {@link Extension }
*
*
*/
public List getExtensions() {
if (extensions == null) {
extensions = new ArrayList();
}
return this.extensions;
}
/**
* Gets the value of the pCovCells property.
*
*
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a set
method for the pCovCells property.
*
*
* For example, to add a new item, do as follows:
*
* getPCovCells().add(newItem);
*
*
*
*
* Objects of the following type(s) are allowed in the list
* {@link PCovCell }
*
*
*/
public List getPCovCells() {
if (pCovCells == null) {
pCovCells = new ArrayList();
}
return this.pCovCells;
}
public boolean hasExtensions() {
return ((this.extensions!= null)&&(this.extensions.size()> 0));
}
public PCovMatrix addExtensions(Extension... extensions) {
getExtensions().addAll(Arrays.asList(extensions));
return this;
}
public boolean hasPCovCells() {
return ((this.pCovCells!= null)&&(this.pCovCells.size()> 0));
}
public PCovMatrix addPCovCells(PCovCell... pCovCells) {
getPCovCells().addAll(Arrays.asList(pCovCells));
return this;
}
@Override
public VisitorAction accept(Visitor visitor) {
VisitorAction status = visitor.visit(this);
visitor.pushParent(this);
if ((status == VisitorAction.CONTINUE)&&hasExtensions()) {
status = org.dmg.pmml.PMMLObject.traverse(visitor, getExtensions());
}
if ((status == VisitorAction.CONTINUE)&&hasPCovCells()) {
status = org.dmg.pmml.PMMLObject.traverse(visitor, getPCovCells());
}
visitor.popParent();
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}string">
* <enumeration value="model"/>
* <enumeration value="robust"/>
* </restriction>
* </simpleType>
*
*
*/
@XmlType(name = "")
@XmlEnum
@Added(Version.PMML_3_2)
public enum Type {
@XmlEnumValue("model")
MODEL("model"),
@XmlEnumValue("robust")
ROBUST("robust");
private final String value;
Type(String v) {
value = v;
}
public String value() {
return value;
}
public static PCovMatrix.Type fromValue(String v) {
for (PCovMatrix.Type c: PCovMatrix.Type.values()) {
if (c.value.equals(v)) {
return c;
}
}
throw new IllegalArgumentException(v);
}
}
}