Here you can find the source of parseDoubleList(String list)
public synchronized static double[] parseDoubleList(String list)
//package com.java2s; import java.util.*; import java.util.regex.*; public class Main { static final Matcher fpMatch = Pattern .compile("([-+]?((\\d*\\.\\d+)|(\\d+))([eE][+-]?\\d+)?)(\\%|in|cm|mm|pt|pc|px|em|ex)?").matcher(""); /**/*from ww w. j ava 2s .c o m*/ * Scans an input string for double values. For each value found, places * in a list. This method regards any characters not part of a floating * point value to be seperators. Thus this will parse whitespace seperated, * comma seperated, and many other separation schemes correctly. */ public synchronized static double[] parseDoubleList(String list) { if (list == null) return null; fpMatch.reset(list); LinkedList doubList = new LinkedList(); while (fpMatch.find()) { String val = fpMatch.group(1); doubList.add(Double.valueOf(val)); } double[] retArr = new double[doubList.size()]; Iterator it = doubList.iterator(); int idx = 0; while (it.hasNext()) { retArr[idx++] = ((Double) it.next()).doubleValue(); } return retArr; } }