Code example for ParsePosition

Methods: getIndex, setIndex

0
        sb.append('(');
        sb.append(value);
        sb.append(')');
 
        final int n = sb.length();
        final int startIndex = pos.getIndex();
        final int endIndex = startIndex + n;
        if (endIndex < source.length() &&
            source.substring(startIndex, endIndex).compareTo(sb.toString()) == 0) {
            ret = Double.valueOf(value);
            pos.setIndex(endIndex);
        } 
 
        return ret;
    } 
 
    /** 
     * Parses <code>source</code> for a number.  This method can parse normal, 
     * numeric values as well as special values.  These special values include 
     * Double.NaN, Double.POSITIVE_INFINITY, Double.NEGATIVE_INFINITY. 
     *