@ 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 ) ; } }
Parses the threshold to remove the matched number string .