@Override
    public String parse(final String threshold, final RangeConfig tc) throws RangeException {
        StringBuilder numberString = new StringBuilder();
        for (int i = 0; i < threshold.length(); i++) {
            if (Character.isDigit(threshold.charAt(i))) {
                numberString.append(threshold.charAt(i));
                continue;
            }
            if (threshold.charAt(i) == '.') {
                if (numberString.toString().endsWith(".")) {
                    numberString.deleteCharAt(numberString.length() - 1);
                    break;
                } else {
                    numberString.append(threshold.charAt(i));
                    continue;
                }
            }
            if (threshold.charAt(i) == '+' || threshold.charAt(i) == '-') {
                if (numberString.length() == 0) {
                    numberString.append(threshold.charAt(i));
                    continue;
                } else {
                    throw new RangeException("Unexpected '" + threshold.charAt(i) + "' sign parsing boundary");
                }
            }
            // throw new InvalidRangeSyntaxException(this,
            // threshold.substring(numberString.length()));
            break;
        }
        if (numberString.length() != 0 && !justSign(numberString.toString())) {
            BigDecimal bd = new BigDecimal(numberString.toString());
            setBoundary(tc, bd);
            return threshold.substring(numberString.length());
        } else {
            throw new InvalidRangeSyntaxException(this, threshold);
        }
    }
@ Override public String parse ( final String threshold , final RangeConfig tc ) throws RangeException { StringBuilder numberString = new StringBuilder ( ) ; for ( int i = 0 ; i < threshold . length ( ) ; i ++ ) { if ( Character . isDigit ( threshold . charAt ( i ) ) ) { numberString . append ( threshold . charAt ( i ) ) ; continue ; } if ( threshold . charAt ( i ) == '.' ) { if ( numberString . toString ( ) . endsWith ( "." ) ) { numberString . deleteCharAt ( numberString . length ( ) - 1 ) ; break ; } else { numberString . append ( threshold . charAt ( i ) ) ; continue ; } } if ( threshold . charAt ( i ) == '+' || threshold . charAt ( i ) == '-' ) { if ( numberString . length ( ) == 0 ) { numberString . append ( threshold . charAt ( i ) ) ; continue ; } else { throw new RangeException ( "Unexpected '" + threshold . charAt ( i ) + "' sign parsing boundary" ) ; } } break ; } if ( numberString . length ( ) != 0 && ! justSign ( numberString . toString ( ) ) ) { BigDecimal bd = new BigDecimal ( numberString . toString ( ) ) ; setBoundary ( tc , bd ) ; return threshold . substring ( numberString . length ( ) ) ; } else { throw new InvalidRangeSyntaxException ( this , threshold ) ; } }
Parses the threshold to remove the matched number string.

No checks are performed against the passed in string: the object assumes
that the string is correct since the {@link #canParse(String)} method
<b>must</b> be called <b>before</b> this method.

@param threshold
The threshold chunk to be parsed
@param tc
The threshold config object. This object will be populated
according to the passed in threshold.


@return the remaining part of the threshold * @throws RangeException
if the threshold can't be parsed