org.dmg.pmml.Matrix Maven / Gradle / Ivy
package org.dmg.pmml;
import java.util.ArrayList;
import java.util.Collection;
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.XmlTransient;
import javax.xml.bind.annotation.XmlType;
import com.sun.xml.bind.Locatable;
import com.sun.xml.bind.annotation.XmlLocation;
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">
* <choice minOccurs="0">
* <group ref="{http://www.dmg.org/PMML-4_2}NUM-ARRAY" maxOccurs="unbounded"/>
* <element ref="{http://www.dmg.org/PMML-4_2}MatCell" maxOccurs="unbounded"/>
* </choice>
* <attribute name="kind" default="any">
* <simpleType>
* <restriction base="{http://www.w3.org/2001/XMLSchema}string">
* <enumeration value="diagonal"/>
* <enumeration value="symmetric"/>
* <enumeration value="any"/>
* </restriction>
* </simpleType>
* </attribute>
* <attribute name="nbRows" type="{http://www.dmg.org/PMML-4_2}INT-NUMBER" />
* <attribute name="nbCols" type="{http://www.dmg.org/PMML-4_2}INT-NUMBER" />
* <attribute name="diagDefault" type="{http://www.dmg.org/PMML-4_2}REAL-NUMBER" />
* <attribute name="offDiagDefault" type="{http://www.dmg.org/PMML-4_2}REAL-NUMBER" />
* </restriction>
* </complexContent>
* </complexType>
*
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"arrays",
"matCells"
})
@XmlRootElement(name = "Matrix")
public class Matrix
extends PMMLObject
implements Locatable
{
@XmlElement(name = "Array")
protected List arrays;
@XmlElement(name = "MatCell")
protected List matCells;
@XmlAttribute(name = "kind")
protected Matrix.Kind kind;
@XmlAttribute(name = "nbRows")
protected Integer nbRows;
@XmlAttribute(name = "nbCols")
protected Integer nbCols;
@XmlAttribute(name = "diagDefault")
protected Double diagDefault;
@XmlAttribute(name = "offDiagDefault")
protected Double offDiagDefault;
@XmlLocation
@XmlTransient
protected Locator locator;
/**
* Gets the value of the arrays 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 arrays property.
*
*
* For example, to add a new item, do as follows:
*
* getArrays().add(newItem);
*
*
*
*
* Objects of the following type(s) are allowed in the list
* {@link Array }
*
*
*/
public List getArrays() {
if (arrays == null) {
arrays = new ArrayList();
}
return this.arrays;
}
/**
* Gets the value of the matCells 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 matCells property.
*
*
* For example, to add a new item, do as follows:
*
* getMatCells().add(newItem);
*
*
*
*
* Objects of the following type(s) are allowed in the list
* {@link MatCell }
*
*
*/
public List getMatCells() {
if (matCells == null) {
matCells = new ArrayList();
}
return this.matCells;
}
/**
* Gets the value of the kind property.
*
* @return
* possible object is
* {@link Matrix.Kind }
*
*/
public Matrix.Kind getKind() {
if (kind == null) {
return Matrix.Kind.ANY;
} else {
return kind;
}
}
/**
* Sets the value of the kind property.
*
* @param value
* allowed object is
* {@link Matrix.Kind }
*
*/
public void setKind(Matrix.Kind value) {
this.kind = value;
}
/**
* Gets the value of the nbRows property.
*
* @return
* possible object is
* {@link Integer }
*
*/
public Integer getNbRows() {
return nbRows;
}
/**
* Sets the value of the nbRows property.
*
* @param value
* allowed object is
* {@link Integer }
*
*/
public void setNbRows(Integer value) {
this.nbRows = value;
}
/**
* Gets the value of the nbCols property.
*
* @return
* possible object is
* {@link Integer }
*
*/
public Integer getNbCols() {
return nbCols;
}
/**
* Sets the value of the nbCols property.
*
* @param value
* allowed object is
* {@link Integer }
*
*/
public void setNbCols(Integer value) {
this.nbCols = value;
}
/**
* Gets the value of the diagDefault property.
*
* @return
* possible object is
* {@link Double }
*
*/
public Double getDiagDefault() {
return diagDefault;
}
/**
* Sets the value of the diagDefault property.
*
* @param value
* allowed object is
* {@link Double }
*
*/
public void setDiagDefault(Double value) {
this.diagDefault = value;
}
/**
* Gets the value of the offDiagDefault property.
*
* @return
* possible object is
* {@link Double }
*
*/
public Double getOffDiagDefault() {
return offDiagDefault;
}
/**
* Sets the value of the offDiagDefault property.
*
* @param value
* allowed object is
* {@link Double }
*
*/
public void setOffDiagDefault(Double value) {
this.offDiagDefault = value;
}
public Matrix withArrays(Array... values) {
if (values!= null) {
for (Array value: values) {
getArrays().add(value);
}
}
return this;
}
public Matrix withArrays(Collection values) {
if (values!= null) {
getArrays().addAll(values);
}
return this;
}
public Matrix withMatCells(MatCell... values) {
if (values!= null) {
for (MatCell value: values) {
getMatCells().add(value);
}
}
return this;
}
public Matrix withMatCells(Collection values) {
if (values!= null) {
getMatCells().addAll(values);
}
return this;
}
public Matrix withKind(Matrix.Kind value) {
setKind(value);
return this;
}
public Matrix withNbRows(Integer value) {
setNbRows(value);
return this;
}
public Matrix withNbCols(Integer value) {
setNbCols(value);
return this;
}
public Matrix withDiagDefault(Double value) {
setDiagDefault(value);
return this;
}
public Matrix withOffDiagDefault(Double value) {
setOffDiagDefault(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);
for (int i = 0; (((status == VisitorAction.CONTINUE)&&(this.arrays!= null))&&(iJava 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="diagonal"/>
* <enumeration value="symmetric"/>
* <enumeration value="any"/>
* </restriction>
* </simpleType>
*
*
*/
@XmlType(name = "")
@XmlEnum
public enum Kind {
@XmlEnumValue("diagonal")
DIAGONAL("diagonal"),
@XmlEnumValue("symmetric")
SYMMETRIC("symmetric"),
@XmlEnumValue("any")
ANY("any");
private final String value;
Kind(String v) {
value = v;
}
public String value() {
return value;
}
public static Matrix.Kind fromValue(String v) {
for (Matrix.Kind c: Matrix.Kind.values()) {
if (c.value.equals(v)) {
return c;
}
}
throw new IllegalArgumentException(v);
}
}
}