org.dmg.pmml.bayesian_network.ContinuousNode Maven / Gradle / Ivy
package org.dmg.pmml.bayesian_network;
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;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.dmg.pmml.DerivedField;
import org.dmg.pmml.Extension;
import org.dmg.pmml.FieldName;
import org.dmg.pmml.HasExtensions;
import org.dmg.pmml.Visitor;
import org.dmg.pmml.VisitorAction;
import org.dmg.pmml.adapters.FieldNameAdapter;
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_3}Extension" maxOccurs="unbounded" minOccurs="0"/>
* <element ref="{http://www.dmg.org/PMML-4_3}DerivedField" maxOccurs="unbounded" minOccurs="0"/>
* <choice maxOccurs="unbounded">
* <element ref="{http://www.dmg.org/PMML-4_3}ContinuousConditionalProbability"/>
* <element ref="{http://www.dmg.org/PMML-4_3}ContinuousDistribution" maxOccurs="unbounded"/>
* </choice>
* </sequence>
* <attribute name="name" use="required" type="{http://www.dmg.org/PMML-4_3}FIELD-NAME" />
* <attribute name="count" type="{http://www.dmg.org/PMML-4_3}REAL-NUMBER" />
* </restriction>
* </complexContent>
* </complexType>
*
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"extensions",
"derivedFields",
"content"
})
@XmlRootElement(name = "ContinuousNode", namespace = "http://www.dmg.org/PMML-4_3")
@Added(Version.PMML_4_3)
public class ContinuousNode
extends org.dmg.pmml.PMMLObject
implements HasExtensions
{
@XmlAttribute(name = "name", required = true)
@XmlJavaTypeAdapter(FieldNameAdapter.class)
private FieldName name;
@XmlAttribute(name = "count")
private Double count;
@XmlElement(name = "Extension", namespace = "http://www.dmg.org/PMML-4_3")
private List extensions;
@XmlElement(name = "DerivedField", namespace = "http://www.dmg.org/PMML-4_3")
private List derivedFields;
@XmlElements({
@XmlElement(name = "ContinuousConditionalProbability", namespace = "http://www.dmg.org/PMML-4_3", type = ContinuousConditionalProbability.class),
@XmlElement(name = "ContinuousDistribution", namespace = "http://www.dmg.org/PMML-4_3", type = ContinuousDistribution.class)
})
private List content;
public ContinuousNode() {
super();
}
public ContinuousNode(final FieldName name) {
super();
this.name = name;
}
/**
* Gets the value of the name property.
*
* @return
* possible object is
* {@link String }
*
*/
public FieldName getName() {
return name;
}
/**
* Sets the value of the name property.
*
* @param name
* allowed object is
* {@link String }
*
*/
public ContinuousNode setName(FieldName name) {
this.name = name;
return this;
}
/**
* Gets the value of the count property.
*
* @return
* possible object is
* {@link Double }
*
*/
public Double getCount() {
return count;
}
/**
* Sets the value of the count property.
*
* @param count
* allowed object is
* {@link Double }
*
*/
public ContinuousNode setCount(Double count) {
this.count = count;
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 derivedFields 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 derivedFields property.
*
*
* For example, to add a new item, do as follows:
*
* getDerivedFields().add(newItem);
*
*
*
*
* Objects of the following type(s) are allowed in the list
* {@link DerivedField }
*
*
*/
public List getDerivedFields() {
if (derivedFields == null) {
derivedFields = new ArrayList();
}
return this.derivedFields;
}
/**
* Gets the value of the content 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 content property.
*
*
* For example, to add a new item, do as follows:
*
* getContent().add(newItem);
*
*
*
*
* Objects of the following type(s) are allowed in the list
* {@link ContinuousConditionalProbability }
* {@link ContinuousDistribution }
*
*
*/
public List getContent() {
if (content == null) {
content = new ArrayList();
}
return this.content;
}
public boolean hasExtensions() {
return ((this.extensions!= null)&&(this.extensions.size()> 0));
}
public ContinuousNode addExtensions(Extension... extensions) {
getExtensions().addAll(Arrays.asList(extensions));
return this;
}
public boolean hasDerivedFields() {
return ((this.derivedFields!= null)&&(this.derivedFields.size()> 0));
}
public ContinuousNode addDerivedFields(DerivedField... derivedFields) {
getDerivedFields().addAll(Arrays.asList(derivedFields));
return this;
}
public boolean hasContent() {
return ((this.content!= null)&&(this.content.size()> 0));
}
public ContinuousNode addContent(org.dmg.pmml.PMMLObject... content) {
getContent().addAll(Arrays.asList(content));
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)&&hasDerivedFields()) {
status = org.dmg.pmml.PMMLObject.traverse(visitor, getDerivedFields());
}
if ((status == VisitorAction.CONTINUE)&&hasContent()) {
status = org.dmg.pmml.PMMLObject.traverse(visitor, getContent());
}
visitor.popParent();
}
if (status == VisitorAction.TERMINATE) {
return VisitorAction.TERMINATE;
}
return VisitorAction.CONTINUE;
}
}