dataField.setName(attr.name()); // String
dataField.setOptype(OPTYPE.CONTINUOUS); // OPTYPE
String[] strCoordinates = null;
strCoordinates = createAnchors(attr.index(), k);
// Add Extension - Coordinate X
ExtensionType extension = _40Factory.eINSTANCE
.createExtensionType();
extension.setName("xCoordinate");
extension.setValue(strCoordinates[0]);
dataField.getExtension().add(extension);
// Add Extension - Coordinate y
extension = _40Factory.eINSTANCE.createExtensionType();
extension.setName("yCoordinate");
extension.setValue(strCoordinates[1]);
dataField.getExtension().add(extension);
dataDictionary.getDataField().add(dataField);
}
DataFieldType dataField = _40Factory.eINSTANCE.createDataFieldType();
dataField.setDataType(DATATYPE.STRING); // DATATYPE
dataField.setName("class"); // String
dataField.setOptype(OPTYPE.CATEGORICAL); // OPTYPE
dataDictionary.getDataField().add(dataField);
Attribute classAttr = data.classAttribute();
Enumeration values = classAttr.enumerateValues();
while (values.hasMoreElements()) {
ValueType valueType = _40Factory.eINSTANCE.createValueType();
valueType.setValue(values.nextElement().toString());
dataField.getValue().add(valueType);
}
Enumeration<?> helpInstances = data.enumerateInstances();
while (helpInstances.hasMoreElements()) {
Instance instance = (Instance) helpInstances.nextElement();
setMinAndMaxOfAttributes(instance);
}
Enumeration<?> instances = data.enumerateInstances();
while (instances.hasMoreElements()) {
Instance instance = (Instance) instances.nextElement();
createPointsU(instance);
}
ExtensionType extension = null;
for (String[] helpBody : bodyU) {
String helpString = "";
helpString = helpBody[0] + " " + helpBody[1] + " " + helpBody[2];
extension = _40Factory.eINSTANCE.createExtensionType();
extension.setName(Integer.toString(bodyU.indexOf(helpBody) + 1));
FeatureMapUtil.addText(extension.getMixed(), helpString);
dataDictionary.getExtension().add(extension);
}
resource.getContents().add(documentRoot);
ByteArrayOutputStream os = new ByteArrayOutputStream();