Search in sources :

Example 1 with DoubleRangeExtractor

use of com.genericworkflownodes.util.ranges.DoubleRangeExtractor in project GenericKnimeNodes by genericworkflownodes.

the class ParamHandler method handleDoubleList.

/**
 * Convert the current element into a DoubleListParameter.
 *
 * @param paramName
 *            The name of the Parameter
 * @param attributes
 *            Attributes of the Parameter.
 */
private void handleDoubleList(String paramName, Attributes attributes) {
    m_currentParameter = new DoubleListParameter(paramName, new ArrayList<Double>());
    // check for restrictions
    String restrs = attributes.getValue(ATTR_RESTRICTIONS);
    if (restrs != null) {
        ((DoubleListParameter) m_currentParameter).setLowerBound(new DoubleRangeExtractor().getLowerBound(restrs));
        ((DoubleListParameter) m_currentParameter).setUpperBound(new DoubleRangeExtractor().getUpperBound(restrs));
    }
}
Also used : DoubleRangeExtractor(com.genericworkflownodes.util.ranges.DoubleRangeExtractor) ArrayList(java.util.ArrayList) DoubleListParameter(com.genericworkflownodes.knime.parameter.DoubleListParameter)

Example 2 with DoubleRangeExtractor

use of com.genericworkflownodes.util.ranges.DoubleRangeExtractor in project GenericKnimeNodes by genericworkflownodes.

the class ParamHandler method handleDoubleType.

/**
 * Convert the current element into a DoubleParameter.
 *
 * @param paramName
 *            The name of the Parameter
 * @param paramValue
 *            The value of the Parameter as given in the param file.
 * @param attributes
 *            Attributes of the Parameter.
 */
private void handleDoubleType(final String paramName, final String paramValue, Attributes attributes) {
    m_currentParameter = new DoubleParameter(paramName, paramValue);
    // check for restrictions
    String restrs = attributes.getValue(ATTR_RESTRICTIONS);
    if (restrs != null) {
        ((DoubleParameter) m_currentParameter).setLowerBound(new DoubleRangeExtractor().getLowerBound(restrs));
        ((DoubleParameter) m_currentParameter).setUpperBound(new DoubleRangeExtractor().getUpperBound(restrs));
    }
}
Also used : DoubleParameter(com.genericworkflownodes.knime.parameter.DoubleParameter) DoubleRangeExtractor(com.genericworkflownodes.util.ranges.DoubleRangeExtractor)

Aggregations

DoubleRangeExtractor (com.genericworkflownodes.util.ranges.DoubleRangeExtractor)2 DoubleListParameter (com.genericworkflownodes.knime.parameter.DoubleListParameter)1 DoubleParameter (com.genericworkflownodes.knime.parameter.DoubleParameter)1 ArrayList (java.util.ArrayList)1