Search in sources :

Example 1 with IntegerRangeExtractor

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

the class ParamHandler method handleIntList.

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

Example 2 with IntegerRangeExtractor

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

the class ParamHandler method handleIntType.

/**
 * Convert the current element into a IntegerParameter.
 *
 * @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 handleIntType(final String paramName, final String paramValue, Attributes attributes) {
    m_currentParameter = new IntegerParameter(paramName, paramValue);
    // check for restrictions
    String restrictions = attributes.getValue(ATTR_RESTRICTIONS);
    if (restrictions != null) {
        ((IntegerParameter) m_currentParameter).setLowerBound(new IntegerRangeExtractor().getLowerBound(restrictions));
        ((IntegerParameter) m_currentParameter).setUpperBound(new IntegerRangeExtractor().getUpperBound(restrictions));
    }
}
Also used : IntegerParameter(com.genericworkflownodes.knime.parameter.IntegerParameter) IntegerRangeExtractor(com.genericworkflownodes.util.ranges.IntegerRangeExtractor)

Aggregations

IntegerRangeExtractor (com.genericworkflownodes.util.ranges.IntegerRangeExtractor)2 IntegerListParameter (com.genericworkflownodes.knime.parameter.IntegerListParameter)1 IntegerParameter (com.genericworkflownodes.knime.parameter.IntegerParameter)1 ArrayList (java.util.ArrayList)1