
org.dmg.pmml.RuleSet 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.XmlElements;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* 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", namespace = "http://www.dmg.org/PMML-4_2")
public class RuleSet
extends org.dmg.pmml.PMMLObject
implements HasExtensions
{
@XmlAttribute(name = "recordCount")
private Double recordCount;
@XmlAttribute(name = "nbCorrect")
private Double nbCorrect;
@XmlAttribute(name = "defaultScore")
private String defaultScore;
@XmlAttribute(name = "defaultConfidence")
private Double defaultConfidence;
@XmlElement(name = "Extension", namespace = "http://www.dmg.org/PMML-4_2")
private List extensions;
@XmlElement(name = "RuleSelectionMethod", namespace = "http://www.dmg.org/PMML-4_2", required = true)
private List ruleSelectionMethods;
@XmlElement(name = "ScoreDistribution", namespace = "http://www.dmg.org/PMML-4_2")
private List scoreDistributions;
@XmlElements({
@XmlElement(name = "SimpleRule", namespace = "http://www.dmg.org/PMML-4_2", type = SimpleRule.class),
@XmlElement(name = "CompoundRule", namespace = "http://www.dmg.org/PMML-4_2", type = CompoundRule.class)
})
private List rules;
public RuleSet() {
super();
}
public RuleSet(final List ruleSelectionMethods) {
super();
this.ruleSelectionMethods = ruleSelectionMethods;
}
/**
* 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 recordCount
* allowed object is
* {@link Double }
*
*/
public RuleSet setRecordCount(Double recordCount) {
this.recordCount = recordCount;
return this;
}
/**
* 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 nbCorrect
* allowed object is
* {@link Double }
*
*/
public RuleSet setNbCorrect(Double nbCorrect) {
this.nbCorrect = nbCorrect;
return this;
}
/**
* 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 defaultScore
* allowed object is
* {@link String }
*
*/
public RuleSet setDefaultScore(String defaultScore) {
this.defaultScore = defaultScore;
return this;
}
/**
* 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 defaultConfidence
* allowed object is
* {@link Double }
*
*/
public RuleSet setDefaultConfidence(Double defaultConfidence) {
this.defaultConfidence = defaultConfidence;
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 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;
}
public boolean hasExtensions() {
return ((this.extensions!= null)&&(this.extensions.size()> 0));
}
public RuleSet addExtensions(Extension... extensions) {
getExtensions().addAll(Arrays.asList(extensions));
return this;
}
public boolean hasRuleSelectionMethods() {
return ((this.ruleSelectionMethods!= null)&&(this.ruleSelectionMethods.size()> 0));
}
public RuleSet addRuleSelectionMethods(RuleSelectionMethod... ruleSelectionMethods) {
getRuleSelectionMethods().addAll(Arrays.asList(ruleSelectionMethods));
return this;
}
public boolean hasScoreDistributions() {
return ((this.scoreDistributions!= null)&&(this.scoreDistributions.size()> 0));
}
public RuleSet addScoreDistributions(ScoreDistribution... scoreDistributions) {
getScoreDistributions().addAll(Arrays.asList(scoreDistributions));
return this;
}
public boolean hasRules() {
return ((this.rules!= null)&&(this.rules.size()> 0));
}
public RuleSet addRules(Rule... rules) {
getRules().addAll(Arrays.asList(rules));
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)&&hasRuleSelectionMethods()) {
status = org.dmg.pmml.PMMLObject.traverse(visitor, getRuleSelectionMethods());
}
if ((status == VisitorAction.CONTINUE)&&hasScoreDistributions()) {
status = org.dmg.pmml.PMMLObject.traverse(visitor, getScoreDistributions());
}
if ((status == VisitorAction.CONTINUE)&&hasRules()) {
status = org.dmg.pmml.PMMLObject.traverse(visitor, getRules());
}
visitor.popParent();
}
if (status == VisitorAction.TERMINATE) {
return VisitorAction.TERMINATE;
}
return VisitorAction.CONTINUE;
}
}