public String format(DataField fld, String val) { if (val == null) { return "null"; } String s = fld.getDataType().value(); return format(s, val); }
public String format(DataField fld, Value val) { if (val == null) { return "null"; } String s = fld.getDataType().value(); return format(s, val); }
public PMMLDataField(MiningField miningField, DataField field) { this.name = miningField.getName(); if (field != null) { this.type = helper.mapDatatype(field.getDataType(), true); } this.dataDictionaryField = field; }
public static String getDataType(PMML pmmlDocument, String fieldName) { DataDictionary dataDictionary = pmmlDocument.getDataDictionary(); for (DataField dataField : dataDictionary.getDataFields()){ if (dataField.getName().equalsIgnoreCase(fieldName)) { DATATYPE datatype = dataField.getDataType(); if (datatype == DATATYPE.DOUBLE) { return XLSKeywords.DATATYPE_NUMBER; } else if (datatype == DATATYPE.STRING) { return XLSKeywords.DATATYPE_TEXT; } else if (datatype == DATATYPE.BOOLEAN) { return XLSKeywords.DATATYPE_BOOLEAN; } } } return null; }
public PMMLDataField(DataField field) { this.type = helper.mapDatatype(field.getDataType(), true); this.name = helper.compactAsJavaId(field.getName()); this.dataDictionaryField = field; }
public PMMLDataField(OutputField outputField, DataField field) { this.name = outputField.getName(); if (outputField.getDataType() != null) { this.type = helper.mapDatatype(outputField.getDataType(), true); } else if (field != null) { this.type = helper.mapDatatype(field.getDataType(), true); } this.dataDictionaryField = field; }
if (outfield != null) { DataField e = null; if (outfield.getRawDataField() != null && outfield.getRawDataField().getDataType() != null) { e = outfield.getRawDataField(); } else if (target != null) {
private DataField copyDataField(DataField df) { if (df == null) { return null; } DataField copy = new DataField(); copy.setDataType(df.getDataType()); copy.setDisplayName(df.getDisplayName()); copy.setIsCyclic(df.getIsCyclic()); copy.setOptype(df.getOptype()); copy.setName(df.getName()); return copy; }