src/main/java/com/feedzai/fos/impl/weka/utils/pmml/PMMLConversionCommons.java
public static weka.core.Attribute buildAttribute(DataField dataField) {
        switch (dataField.getOptype()) {
            case CONTINUOUS:
                return new weka.core.Attribute(dataField.getName().getValue());
            case CATEGORICAL:
                List<Value> values = dataField.getValues();
                FastVector nominalValues = new FastVector();
                for (Value value : values) {
                    nominalValues.addElement(value.getValue());
                }

                return new weka.core.Attribute(dataField.getName().getValue(), nominalValues);
            default:
                throw new RuntimeException("PMML DataField OPTYPE " + dataField.getOptype() + " not supported.");
        }
    }
public static weka.core.Attribute buildAttribute(DataField dataField) {
        switch (dataField.getOptype()) {
            case CONTINUOUS:
                return new weka.core.Attribute(dataField.getName().getValue());
            case CATEGORICAL:
                List<Value> values = dataField.getValues();
                FastVector nominalValues = new FastVector();
                for (Value value : values) {
                    nominalValues.addElement(value.getValue());
                }

                return new weka.core.Attribute(dataField.getName().getValue(), nominalValues);
            default:
                throw new RuntimeException("PMML DataField OPTYPE " + dataField.getOptype() + " not supported.");
        }
    }
public static weka . core . Attribute buildAttribute ( DataField dataField ) { switch ( dataField . getOptype ( ) ) { case CONTINUOUS : return new weka . core . Attribute ( dataField . getName ( ) . getValue ( ) ) ; case CATEGORICAL : List < Value > values = dataField . getValues ( ) ; FastVector nominalValues = new FastVector ( ) ; for ( Value value : values ) { nominalValues . addElement ( value . getValue ( ) ) ; } return new weka . core . Attribute ( dataField . getName ( ) . getValue ( ) , nominalValues ) ; default : throw new RuntimeException ( "PMML DataField OPTYPE " + dataField . getOptype ( ) + " not supported." ) ; } }
Creates a new {@link weka.core.Attribute} from a {@link org.dmg.pmml.DataField PMML DataField}.

@param dataField The {@link org.dmg.pmml.DataField PMML DataField} representing the attribute.
@return A new {@link weka.core.Attribute}.
Creates a new { @link weka . core . Attribute } from a { @link org . dmg . pmml . DataField PMML DataField } .