Package java.text

Examples of java.text.NumberFormat.parseObject()


    if (dfs.getGroupingSeparator() == '\u00a0')
      value = value.replace(' ', '\u00a0');
        

    ParsePosition pp = new ParsePosition(0);
    Number num = (Number) fmt.parseObject(value,pp);

    if (pp.getIndex() != value.length())
    {
      Object label = ConverterUtils.getComponentLabel(component);
      Object[] params = null;
View Full Code Here


    if (dfs.getGroupingSeparator() == '\u00a0')
      value = value.replace(' ', '\u00a0');
        

    ParsePosition pp = new ParsePosition(0);
    Number num = (Number) fmt.parseObject(value,pp);

    if (pp.getIndex() != value.length())
    {
      Object label = ConverterUtils.getComponentLabel(component);
      Object[] params = null;
View Full Code Here

    if (dfs.getGroupingSeparator() == '\u00a0')
      value = value.replace(' ', '\u00a0');
        

    ParsePosition pp = new ParsePosition(0);
    Number num = (Number) fmt.parseObject(value,pp);

    if (pp.getIndex() != value.length())
    {
      Object label = ConverterUtils.getComponentLabel(component);
      Object[] params = {label, value, getPattern()};
View Full Code Here

      dfs.setGroupingSeparator(' ');
      df.setDecimalFormatSymbols(dfs);
      changed = true;
    }
    ParsePosition pp = new ParsePosition(0);
    Number num = (Number) fmt.parseObject(value,pp);
    if(changed)
    {
      dfs.setGroupingSeparator('\u00a0');
      df.setDecimalFormatSymbols(dfs);
    }
View Full Code Here

      df.setDecimalFormatSymbols(dfs);
    }
   
    if(num == null)
    {
      num = (Number) fmt.parseObject(value, pp);
    }

    if (pp.getIndex() != value.length())
    {
      Object label = ConverterUtils.getComponentLabel(component);
View Full Code Here

        if (serverVersion == null)
            return 0;

        /* Get first major version part */
        parsed = (Long) numformat.parseObject(serverVersion, parsepos);
        if (parsed == null) {
            return 0;
        }
        if (parsed.intValue() >= 10000)
        {
View Full Code Here

        /*
         * Get second major version part. If this isn't purely an integer,
         * accept the integer part and return with a minor version of zero,
         * so we cope with 8.1devel, etc.
         */
        parsed = (Long) numformat.parseObject(serverVersion, parsepos);
        if (parsed == null) {
            /*
             * Failed to parse second part of minor version at all. Half
             * a major version is useless, return 0.
             */
 
View Full Code Here

        else
            /* Doesn't look like an x.y.z version, return what we have */
            return vers;

        /* Try to parse any remainder as a minor version */
        parsed = (Long) numformat.parseObject(serverVersion, parsepos);
        if (parsed != null) {
      if (parsed.intValue() > 99)
        throw new NumberFormatException("Unsupported minor version value > 99 in invalid version string: " + serverVersion);
            vers = vers + parsed.intValue();
        }
View Full Code Here

     
      changed = true;
    }
   
    ParsePosition pp = new ParsePosition(0)
    Number num = (Number)fmt.parseObject(value, pp);  
   
    // The following determines whether the percent/currency symbol was left off.
    int typeIdx = _getType(pattern, type);
    if (num == null && (typeIdx == _CURRENCY_TYPE || typeIdx == _PERCENT_TYPE))
    {
View Full Code Here

      }
     
      // Assume the percent/currency symbol was left off, in which case we should
      // be able to parse 'value' as a Number.
      // An error occured, so the index of pp should still be 0.
      num = (Number)nfmt.parseObject(value, pp);     
      if (typeIdx == _PERCENT_TYPE && num != null)
        num = num.doubleValue() / 100.0;
    }
   
    // Change it back, since we could have been handed a cached reference. This
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.