Java Double Array Create doubleArrayFromString(final String data)

Here you can find the source of doubleArrayFromString(final String data)

Description

double Array From String

License

Open Source License

Declaration

private static double[] doubleArrayFromString(final String data) 

Method Source Code

//package com.java2s;

public class Main {
    private static final String CONFIG_EMPTY = "NONE";
    private static final String CONFIG_SEPARATOR_ARRAY = ";";

    private static double[] doubleArrayFromString(final String data) {
        final double[] result;
        if (data.equals(CONFIG_EMPTY)) {
            result = null;//  www  .  j a  v a  2 s . c  o m
        } else {
            final String[] split = data.split(CONFIG_SEPARATOR_ARRAY);
            result = new double[split.length];
            for (int i = 0; i < split.length; i++) {
                result[i] = Double.valueOf(split[i].trim());
            }
        }
        return result;
    }
}

Related

  1. doubleArray(Double... elements)
  2. doubleArray(int... in)
  3. doubleArray(String data)
  4. doubleArray2Json(double[] array)
  5. doubleArrayFromString(String record)
  6. doubleArraySize(byte[] array)
  7. toDoubleA(byte[] data)
  8. toDoubleArr(short[] arr)