org.dmg.pmml.Array Maven / Gradle / Ivy
package org.dmg.pmml;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlValue;
import com.sun.xml.bind.Locatable;
import com.sun.xml.bind.annotation.XmlLocation;
import org.xml.sax.Locator;
/**
* Java class for anonymous complex type.
*
*
The following schema fragment specifies the expected content contained within this class.
*
*
* <complexType>
* <simpleContent>
* <extension base="<http://www.w3.org/2001/XMLSchema>string">
* <attribute name="n" type="{http://www.dmg.org/PMML-4_2}INT-NUMBER" />
* <attribute name="type" use="required">
* <simpleType>
* <restriction base="{http://www.w3.org/2001/XMLSchema}string">
* <enumeration value="int"/>
* <enumeration value="real"/>
* <enumeration value="string"/>
* </restriction>
* </simpleType>
* </attribute>
* </extension>
* </simpleContent>
* </complexType>
*
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"value"
})
@XmlRootElement(name = "Array")
public class Array
extends PMMLObject
implements Locatable
{
@XmlValue
protected String value;
@XmlAttribute(name = "n")
protected Integer n;
@XmlAttribute(name = "type", required = true)
protected Array.Type type;
@XmlLocation
@XmlTransient
protected Locator locator;
public Array() {
super();
}
public Array(final String value, final Array.Type type) {
super();
this.value = value;
this.type = type;
}
/**
* Gets the value of the value property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getValue() {
return value;
}
/**
* Sets the value of the value property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setValue(String value) {
this.value = value;
}
/**
* Gets the value of the n property.
*
* @return
* possible object is
* {@link Integer }
*
*/
public Integer getN() {
return n;
}
/**
* Sets the value of the n property.
*
* @param value
* allowed object is
* {@link Integer }
*
*/
public void setN(Integer value) {
this.n = value;
}
/**
* Gets the value of the type property.
*
* @return
* possible object is
* {@link Array.Type }
*
*/
public Array.Type getType() {
return type;
}
/**
* Sets the value of the type property.
*
* @param value
* allowed object is
* {@link Array.Type }
*
*/
public void setType(Array.Type value) {
this.type = value;
}
public Array withValue(String value) {
setValue(value);
return this;
}
public Array withN(Integer value) {
setN(value);
return this;
}
public Array withType(Array.Type value) {
setType(value);
return this;
}
public Locator sourceLocation() {
return locator;
}
public void setSourceLocation(Locator newLocator) {
locator = newLocator;
}
@Override
public VisitorAction accept(Visitor visitor) {
VisitorAction status = visitor.visit(this);
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="int"/>
* <enumeration value="real"/>
* <enumeration value="string"/>
* </restriction>
* </simpleType>
*
*
*/
@XmlType(name = "")
@XmlEnum
public enum Type {
@XmlEnumValue("int")
INT("int"),
@XmlEnumValue("real")
REAL("real"),
@XmlEnumValue("string")
STRING("string");
private final String value;
Type(String v) {
value = v;
}
public String value() {
return value;
}
public static Array.Type fromValue(String v) {
for (Array.Type c: Array.Type.values()) {
if (c.value.equals(v)) {
return c;
}
}
throw new IllegalArgumentException(v);
}
}
}