
org.dmg.pmml.Decisions Maven / Gradle / Ivy
package org.dmg.pmml;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
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.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}Decision" maxOccurs="unbounded"/>
* </sequence>
* <attribute name="businessProblem" type="{http://www.w3.org/2001/XMLSchema}string" />
* <attribute name="description" type="{http://www.w3.org/2001/XMLSchema}string" />
* </restriction>
* </complexContent>
* </complexType>
*
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"extensions",
"decisions"
})
@XmlRootElement(name = "Decisions", namespace = "http://www.dmg.org/PMML-4_2")
@Added(Version.PMML_4_1)
public class Decisions
extends org.dmg.pmml.PMMLObject
implements Iterable , HasExtensions
{
@XmlAttribute(name = "businessProblem")
private String businessProblem;
@XmlAttribute(name = "description")
private String description;
@XmlElement(name = "Extension", namespace = "http://www.dmg.org/PMML-4_2")
private List extensions;
@XmlElement(name = "Decision", namespace = "http://www.dmg.org/PMML-4_2", required = true)
private List decisions;
public Decisions() {
super();
}
public Decisions(final List decisions) {
super();
this.decisions = decisions;
}
/**
* Gets the value of the businessProblem property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getBusinessProblem() {
return businessProblem;
}
/**
* Sets the value of the businessProblem property.
*
* @param businessProblem
* allowed object is
* {@link String }
*
*/
public Decisions setBusinessProblem(String businessProblem) {
this.businessProblem = businessProblem;
return this;
}
/**
* Gets the value of the description property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getDescription() {
return description;
}
/**
* Sets the value of the description property.
*
* @param description
* allowed object is
* {@link String }
*
*/
public Decisions setDescription(String description) {
this.description = description;
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 decisions 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 decisions property.
*
*
* For example, to add a new item, do as follows:
*
* getDecisions().add(newItem);
*
*
*
*
* Objects of the following type(s) are allowed in the list
* {@link Decision }
*
*
*/
public List getDecisions() {
if (decisions == null) {
decisions = new ArrayList();
}
return this.decisions;
}
public Iterator iterator() {
return getDecisions().iterator();
}
public boolean hasExtensions() {
return ((this.extensions!= null)&&(this.extensions.size()> 0));
}
public Decisions addExtensions(Extension... extensions) {
getExtensions().addAll(Arrays.asList(extensions));
return this;
}
public boolean hasDecisions() {
return ((this.decisions!= null)&&(this.decisions.size()> 0));
}
public Decisions addDecisions(Decision... decisions) {
getDecisions().addAll(Arrays.asList(decisions));
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)&&hasDecisions()) {
status = org.dmg.pmml.PMMLObject.traverse(visitor, getDecisions());
}
visitor.popParent();
}
if (status == VisitorAction.TERMINATE) {
return VisitorAction.TERMINATE;
}
return VisitorAction.CONTINUE;
}
}