org.dmg.pmml.RuleSet 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.XmlElements;
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">
* <sequence>
* <element ref="{http://www.dmg.org/PMML-4_2}Extension" maxOccurs="unbounded" minOccurs="0"/>
* <element ref="{http://www.dmg.org/PMML-4_2}RuleSelectionMethod" maxOccurs="unbounded"/>
* <element ref="{http://www.dmg.org/PMML-4_2}ScoreDistribution" maxOccurs="unbounded" minOccurs="0"/>
* <group ref="{http://www.dmg.org/PMML-4_2}Rule" maxOccurs="unbounded" minOccurs="0"/>
* </sequence>
* <attribute name="recordCount" type="{http://www.dmg.org/PMML-4_2}NUMBER" />
* <attribute name="nbCorrect" type="{http://www.dmg.org/PMML-4_2}NUMBER" />
* <attribute name="defaultScore" type="{http://www.w3.org/2001/XMLSchema}string" />
* <attribute name="defaultConfidence" type="{http://www.dmg.org/PMML-4_2}NUMBER" />
* </restriction>
* </complexContent>
* </complexType>
*
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"extensions",
"ruleSelectionMethods",
"scoreDistributions",
"rules"
})
@XmlRootElement(name = "RuleSet")
public class RuleSet
extends PMMLObject
implements Locatable, HasExtensions
{
@XmlElement(name = "Extension")
protected List extensions;
@XmlElement(name = "RuleSelectionMethod", required = true)
protected List ruleSelectionMethods;
@XmlElement(name = "ScoreDistribution")
protected List scoreDistributions;
@XmlElements({
@XmlElement(name = "SimpleRule", type = SimpleRule.class),
@XmlElement(name = "CompoundRule", type = CompoundRule.class)
})
protected List rules;
@XmlAttribute(name = "recordCount")
protected Double recordCount;
@XmlAttribute(name = "nbCorrect")
protected Double nbCorrect;
@XmlAttribute(name = "defaultScore")
protected String defaultScore;
@XmlAttribute(name = "defaultConfidence")
protected Double defaultConfidence;
@XmlLocation
@XmlTransient
protected Locator locator;
/**
* 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 ruleSelectionMethods 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 ruleSelectionMethods property.
*
*
* For example, to add a new item, do as follows:
*
* getRuleSelectionMethods().add(newItem);
*
*
*
*
* Objects of the following type(s) are allowed in the list
* {@link RuleSelectionMethod }
*
*
*/
public List getRuleSelectionMethods() {
if (ruleSelectionMethods == null) {
ruleSelectionMethods = new ArrayList();
}
return this.ruleSelectionMethods;
}
/**
* Gets the value of the scoreDistributions 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 scoreDistributions property.
*
*
* For example, to add a new item, do as follows:
*
* getScoreDistributions().add(newItem);
*
*
*
*
* Objects of the following type(s) are allowed in the list
* {@link ScoreDistribution }
*
*
*/
public List getScoreDistributions() {
if (scoreDistributions == null) {
scoreDistributions = new ArrayList();
}
return this.scoreDistributions;
}
/**
* Gets the value of the rules 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 rules property.
*
*
* For example, to add a new item, do as follows:
*
* getRules().add(newItem);
*
*
*
*
* Objects of the following type(s) are allowed in the list
* {@link SimpleRule }
* {@link CompoundRule }
*
*
*/
public List getRules() {
if (rules == null) {
rules = new ArrayList();
}
return this.rules;
}
/**
* Gets the value of the recordCount property.
*
* @return
* possible object is
* {@link Double }
*
*/
public Double getRecordCount() {
return recordCount;
}
/**
* Sets the value of the recordCount property.
*
* @param value
* allowed object is
* {@link Double }
*
*/
public void setRecordCount(Double value) {
this.recordCount = value;
}
/**
* Gets the value of the nbCorrect property.
*
* @return
* possible object is
* {@link Double }
*
*/
public Double getNbCorrect() {
return nbCorrect;
}
/**
* Sets the value of the nbCorrect property.
*
* @param value
* allowed object is
* {@link Double }
*
*/
public void setNbCorrect(Double value) {
this.nbCorrect = value;
}
/**
* Gets the value of the defaultScore property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getDefaultScore() {
return defaultScore;
}
/**
* Sets the value of the defaultScore property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setDefaultScore(String value) {
this.defaultScore = value;
}
/**
* Gets the value of the defaultConfidence property.
*
* @return
* possible object is
* {@link Double }
*
*/
public Double getDefaultConfidence() {
return defaultConfidence;
}
/**
* Sets the value of the defaultConfidence property.
*
* @param value
* allowed object is
* {@link Double }
*
*/
public void setDefaultConfidence(Double value) {
this.defaultConfidence = value;
}
public RuleSet withExtensions(Extension... values) {
if (values!= null) {
for (Extension value: values) {
getExtensions().add(value);
}
}
return this;
}
public RuleSet withExtensions(Collection values) {
if (values!= null) {
getExtensions().addAll(values);
}
return this;
}
public RuleSet withRuleSelectionMethods(RuleSelectionMethod... values) {
if (values!= null) {
for (RuleSelectionMethod value: values) {
getRuleSelectionMethods().add(value);
}
}
return this;
}
public RuleSet withRuleSelectionMethods(Collection values) {
if (values!= null) {
getRuleSelectionMethods().addAll(values);
}
return this;
}
public RuleSet withScoreDistributions(ScoreDistribution... values) {
if (values!= null) {
for (ScoreDistribution value: values) {
getScoreDistributions().add(value);
}
}
return this;
}
public RuleSet withScoreDistributions(Collection values) {
if (values!= null) {
getScoreDistributions().addAll(values);
}
return this;
}
public RuleSet withRules(Rule... values) {
if (values!= null) {
for (Rule value: values) {
getRules().add(value);
}
}
return this;
}
public RuleSet withRules(Collection values) {
if (values!= null) {
getRules().addAll(values);
}
return this;
}
public RuleSet withRecordCount(Double value) {
setRecordCount(value);
return this;
}
public RuleSet withNbCorrect(Double value) {
setNbCorrect(value);
return this;
}
public RuleSet withDefaultScore(String value) {
setDefaultScore(value);
return this;
}
public RuleSet withDefaultConfidence(Double value) {
setDefaultConfidence(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.extensions!= null))&&(i