All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.dmg.pmml.DataField Maven / Gradle / Ivy

There is a newer version: 1.6.7
Show newest version

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.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.dmg.pmml.adapters.FieldNameAdapter;


/**
 * 

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"/>
 *         <sequence>
 *           <element ref="{http://www.dmg.org/PMML-4_2}Interval" maxOccurs="unbounded" minOccurs="0"/>
 *           <element ref="{http://www.dmg.org/PMML-4_2}Value" maxOccurs="unbounded" minOccurs="0"/>
 *         </sequence>
 *       </sequence>
 *       <attribute name="name" use="required" type="{http://www.dmg.org/PMML-4_2}FIELD-NAME" />
 *       <attribute name="displayName" type="{http://www.w3.org/2001/XMLSchema}string" />
 *       <attribute name="optype" use="required" type="{http://www.dmg.org/PMML-4_2}OPTYPE" />
 *       <attribute name="dataType" use="required" type="{http://www.dmg.org/PMML-4_2}DATATYPE" />
 *       <attribute name="taxonomy" type="{http://www.w3.org/2001/XMLSchema}string" />
 *       <attribute name="isCyclic" default="0">
 *         <simpleType>
 *           <restriction base="{http://www.w3.org/2001/XMLSchema}string">
 *             <enumeration value="0"/>
 *             <enumeration value="1"/>
 *           </restriction>
 *         </simpleType>
 *       </attribute>
 *     </restriction>
 *   </complexContent>
 * </complexType>
 * 
* * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "extensions", "intervals", "values" }) @XmlRootElement(name = "DataField", namespace = "http://www.dmg.org/PMML-4_2") public class DataField extends TypeDefinitionField implements HasExtensions { @XmlAttribute(name = "name", required = true) @XmlJavaTypeAdapter(FieldNameAdapter.class) private FieldName name; @XmlAttribute(name = "displayName") private String displayName; @XmlAttribute(name = "optype", required = true) private OpType opType; @XmlAttribute(name = "dataType", required = true) private DataType dataType; @XmlAttribute(name = "taxonomy") private String taxonomy; @XmlAttribute(name = "isCyclic") private DataField.Cyclic cyclic; @XmlElement(name = "Extension", namespace = "http://www.dmg.org/PMML-4_2") private List extensions; @XmlElement(name = "Interval", namespace = "http://www.dmg.org/PMML-4_2") private List intervals; @XmlElement(name = "Value", namespace = "http://www.dmg.org/PMML-4_2") private List values; public DataField() { super(); } public DataField(final FieldName name, final OpType opType, final DataType dataType) { super(); this.name = name; this.opType = opType; this.dataType = dataType; } /** * 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 DataField setName(FieldName name) { this.name = name; return this; } /** * Gets the value of the displayName property. * * @return * possible object is * {@link String } * */ public String getDisplayName() { return displayName; } /** * Sets the value of the displayName property. * * @param displayName * allowed object is * {@link String } * */ public DataField setDisplayName(String displayName) { this.displayName = displayName; return this; } /** * Gets the value of the opType property. * * @return * possible object is * {@link OpType } * */ public OpType getOpType() { return opType; } /** * Sets the value of the opType property. * * @param opType * allowed object is * {@link OpType } * */ public DataField setOpType(OpType opType) { this.opType = opType; return this; } /** * Gets the value of the dataType property. * * @return * possible object is * {@link DataType } * */ public DataType getDataType() { return dataType; } /** * Sets the value of the dataType property. * * @param dataType * allowed object is * {@link DataType } * */ public DataField setDataType(DataType dataType) { this.dataType = dataType; return this; } /** * Gets the value of the taxonomy property. * * @return * possible object is * {@link String } * */ public String getTaxonomy() { return taxonomy; } /** * Sets the value of the taxonomy property. * * @param taxonomy * allowed object is * {@link String } * */ public DataField setTaxonomy(String taxonomy) { this.taxonomy = taxonomy; return this; } /** * Gets the value of the cyclic property. * * @return * possible object is * {@link DataField.Cyclic } * */ public DataField.Cyclic getCyclic() { if (cyclic == null) { return DataField.Cyclic.ZERO; } else { return cyclic; } } /** * Sets the value of the cyclic property. * * @param cyclic * allowed object is * {@link DataField.Cyclic } * */ public DataField setCyclic(DataField.Cyclic cyclic) { this.cyclic = cyclic; 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 intervals 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 intervals property. * *

* For example, to add a new item, do as follows: *

     *    getIntervals().add(newItem);
     * 
* * *

* Objects of the following type(s) are allowed in the list * {@link Interval } * * */ public List getIntervals() { if (intervals == null) { intervals = new ArrayList(); } return this.intervals; } /** * Gets the value of the values 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 values property. * *

* For example, to add a new item, do as follows: *

     *    getValues().add(newItem);
     * 
* * *

* Objects of the following type(s) are allowed in the list * {@link Value } * * */ public List getValues() { if (values == null) { values = new ArrayList(); } return this.values; } public boolean hasExtensions() { return ((this.extensions!= null)&&(this.extensions.size()> 0)); } public DataField addExtensions(Extension... extensions) { getExtensions().addAll(Arrays.asList(extensions)); return this; } public boolean hasIntervals() { return ((this.intervals!= null)&&(this.intervals.size()> 0)); } public DataField addIntervals(Interval... intervals) { getIntervals().addAll(Arrays.asList(intervals)); return this; } public boolean hasValues() { return ((this.values!= null)&&(this.values.size()> 0)); } public DataField addValues(Value... values) { getValues().addAll(Arrays.asList(values)); return this; } @Override public VisitorAction accept(Visitor visitor) { VisitorAction status = visitor.visit(this); visitor.pushParent(this); if ((status == VisitorAction.CONTINUE)&&hasExtensions()) { status = PMMLObject.traverse(visitor, getExtensions()); } if ((status == VisitorAction.CONTINUE)&&hasIntervals()) { status = PMMLObject.traverse(visitor, getIntervals()); } if ((status == VisitorAction.CONTINUE)&&hasValues()) { status = PMMLObject.traverse(visitor, getValues()); } visitor.popParent(); if (status == VisitorAction.TERMINATE) { return VisitorAction.TERMINATE; } return VisitorAction.CONTINUE; } /** *

Java 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="0"/>
     *     <enumeration value="1"/>
     *   </restriction>
     * </simpleType>
     * 
* */ @XmlType(name = "") @XmlEnum public enum Cyclic { @XmlEnumValue("0") ZERO("0"), @XmlEnumValue("1") ONE("1"); private final String value; Cyclic(String v) { value = v; } public String value() { return value; } public static DataField.Cyclic fromValue(String v) { for (DataField.Cyclic c: DataField.Cyclic.values()) { if (c.value.equals(v)) { return c; } } throw new IllegalArgumentException(v); } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy