Java Utililty Methods Double Number From

List of utility methods to do Double Number From

Description

The list of methods to do Double Number From are organized into topic(s).

Method

double[]toDoubles(byte[] bytes)
to Doubles
int size = toInt(bytes, 0);
double[] result = new double[size];
int offset = SIZEOF_INT;
for (int i = 0; i < size; i++) {
    result[i] = toDouble(bytes, offset);
    offset += SIZEOF_LONG;
return result;
...
double[]toDoubles(byte[] value, int offset, int num)
to Doubles
double[] values = new double[num];
int idx = 0;
for (int i = offset; i < offset + (num * 8); i += 8) {
    values[idx++] = getDouble(value, i);
return values;
double[]toDoubles(Double[] values)
to Doubles
return toDoubles(values, DEFAULT_DOUBLE);
double[][]toDoubles(int[][] intPts)
to Doubles
int nDimensions = intPts[0].length;
double[][] pts = new double[intPts.length][nDimensions];
for (int i = 0; i < intPts.length; i++) {
    for (int n = 0; n < nDimensions; n++) {
        pts[i][n] = ((Integer) intPts[i][n]).doubleValue();
return pts;
...
double[]toDoubles(Object[] extraArgs)
to Doubles
double[] ret = new double[extraArgs.length];
for (int i = 0; i < extraArgs.length; i++) {
    ret[i] = Double.valueOf(extraArgs[i].toString());
return ret;
doubletoDoubleScore(Float score)
This is from mneme Convert the points / score value into a double, without picking up float to double conversion junk
if (score == null)
    return 0.0d;
float times100 = score.floatValue() * 100f;
Double rv = (double) times100;
rv = rv / 100d;
return rv;
StringtoDoubleString(Double d)
Formats the specified double as string
if (d == null) {
    return ZERO_STRING;
return d.toString();
doubletoDoubleValue(Object number)
Returns the number object as a double
if (number instanceof Double) {
    return ((Double) number).doubleValue();
if (number instanceof Float) {
    return ((Float) number).doubleValue();
if (number instanceof Long) {
    return ((Long) number).doubleValue();
...
DoubletoDoubleValue(Object value)
to Double Value
if ((value == null) || (value.getClass() == Double.class)) {
    return (Double) value;
if (value instanceof Number) {
    return ((Number) value).doubleValue();
throw new IllegalArgumentException("value must be instance of Number.");