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

org.dmg.pmml.DerivedField 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;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.dmg.pmml.adapters.FieldNameAdapter;
import org.jpmml.schema.Removed;
import org.jpmml.schema.Required;
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"/>
 *         <group ref="{http://www.dmg.org/PMML-4_3}EXPRESSION"/>
 *         <element ref="{http://www.dmg.org/PMML-4_3}Interval" maxOccurs="unbounded" minOccurs="0"/>
 *         <element ref="{http://www.dmg.org/PMML-4_3}Value" maxOccurs="unbounded" minOccurs="0"/>
 *       </sequence>
 *       <attribute name="name" type="{http://www.dmg.org/PMML-4_3}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_3}OPTYPE" />
 *       <attribute name="dataType" use="required" type="{http://www.dmg.org/PMML-4_3}DATATYPE" />
 *     </restriction>
 *   </complexContent>
 * </complexType>
 * 
* * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "extensions", "expression", "intervals", "values" }) @XmlRootElement(name = "DerivedField", namespace = "http://www.dmg.org/PMML-4_3") public class DerivedField extends TypeDefinitionField implements HasExpression, HasExtensions { @XmlAttribute(name = "name") @XmlJavaTypeAdapter(FieldNameAdapter.class) private FieldName name; @XmlAttribute(name = "displayName") private String displayName; @XmlAttribute(name = "optype", required = true) @Required(Version.PMML_3_1) private OpType opType; @XmlAttribute(name = "dataType", required = true) private DataType dataType; @XmlElement(name = "Extension", namespace = "http://www.dmg.org/PMML-4_3") private List extensions; @XmlElements({ @XmlElement(name = "Constant", namespace = "http://www.dmg.org/PMML-4_3", type = Constant.class), @XmlElement(name = "FieldRef", namespace = "http://www.dmg.org/PMML-4_3", type = FieldRef.class), @XmlElement(name = "NormContinuous", namespace = "http://www.dmg.org/PMML-4_3", type = NormContinuous.class), @XmlElement(name = "NormDiscrete", namespace = "http://www.dmg.org/PMML-4_3", type = NormDiscrete.class), @XmlElement(name = "Discretize", namespace = "http://www.dmg.org/PMML-4_3", type = Discretize.class), @XmlElement(name = "MapValues", namespace = "http://www.dmg.org/PMML-4_3", type = MapValues.class), @XmlElement(name = "TextIndex", namespace = "http://www.dmg.org/PMML-4_3", type = TextIndex.class), @XmlElement(name = "Apply", namespace = "http://www.dmg.org/PMML-4_3", type = Apply.class), @XmlElement(name = "Aggregate", namespace = "http://www.dmg.org/PMML-4_3", type = Aggregate.class), @XmlElement(name = "Lag", namespace = "http://www.dmg.org/PMML-4_3", type = Lag.class) }) private Expression expression; @XmlElement(name = "Interval", namespace = "http://www.dmg.org/PMML-4_3") @Removed(Version.PMML_3_1) private List intervals; @XmlElement(name = "Value", namespace = "http://www.dmg.org/PMML-4_3") private List values; public DerivedField() { super(); } public DerivedField(final OpType opType, final DataType dataType) { super(); 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 DerivedField 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 DerivedField 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 DerivedField 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 DerivedField setDataType(DataType dataType) { this.dataType = dataType; 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 expression property. * * @return * possible object is * {@link Constant } * {@link FieldRef } * {@link NormContinuous } * {@link NormDiscrete } * {@link Discretize } * {@link MapValues } * {@link TextIndex } * {@link Apply } * {@link Aggregate } * {@link Lag } * */ public Expression getExpression() { return expression; } /** * Sets the value of the expression property. * * @param expression * allowed object is * {@link Constant } * {@link FieldRef } * {@link NormContinuous } * {@link NormDiscrete } * {@link Discretize } * {@link MapValues } * {@link TextIndex } * {@link Apply } * {@link Aggregate } * {@link Lag } * */ public DerivedField setExpression(Expression expression) { this.expression = expression; return this; } /** * 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 DerivedField addExtensions(Extension... extensions) { getExtensions().addAll(Arrays.asList(extensions)); return this; } public boolean hasIntervals() { return ((this.intervals!= null)&&(this.intervals.size()> 0)); } public DerivedField addIntervals(Interval... intervals) { getIntervals().addAll(Arrays.asList(intervals)); return this; } public boolean hasValues() { return ((this.values!= null)&&(this.values.size()> 0)); } public DerivedField addValues(Value... values) { getValues().addAll(Arrays.asList(values)); 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 = PMMLObject.traverse(visitor, getExtensions()); } if (status == VisitorAction.CONTINUE) { status = PMMLObject.traverse(visitor, getExpression()); } 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; } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy