Example usage for org.apache.commons.lang3 ArrayUtils EMPTY_DOUBLE_ARRAY

List of usage examples for org.apache.commons.lang3 ArrayUtils EMPTY_DOUBLE_ARRAY

Introduction

In this page you can find the example usage for org.apache.commons.lang3 ArrayUtils EMPTY_DOUBLE_ARRAY.

Prototype

null EMPTY_DOUBLE_ARRAY

To view the source code for org.apache.commons.lang3 ArrayUtils EMPTY_DOUBLE_ARRAY.

Click Source Link

Document

An empty immutable double array.

Usage

From source file:cpcc.core.utils.GeoJsonUtils.java

/**
 * @param obj the GeoJSON object./*from   ww  w .  ja  v  a  2s.  co m*/
 * @return the bounding box of the object.
 */
public static double[] findBoundingBox(GeoJsonObject obj) {
    if (obj instanceof Point) {
        LngLatAlt c = ((Point) obj).getCoordinates();
        return new double[] { c.getLongitude(), c.getLatitude(), c.getLongitude(), c.getLatitude() };
    }

    if (obj instanceof Polygon) {
        List<List<LngLatAlt>> geometryList = ((Polygon) obj).getCoordinates();
        double[] boundingBox = new double[] { Double.NaN, Double.NaN, Double.NaN, Double.NaN };
        for (List<LngLatAlt> positionList : geometryList) {
            for (LngLatAlt position : positionList) {
                mergeBoundingBox(boundingBox, position);
            }
        }
        return boundingBox;
    }

    return ArrayUtils.EMPTY_DOUBLE_ARRAY;
}

From source file:com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck.java

/**
 * Sets the numbers to ignore in the check.
 * BeanUtils converts numeric token list to double array automatically.
 * @param list list of numbers to ignore.
 *//*from www.  ja v  a  2s  .c o  m*/
public void setIgnoreNumbers(double... list) {
    if (list.length == 0) {
        ignoreNumbers = ArrayUtils.EMPTY_DOUBLE_ARRAY;
    } else {
        ignoreNumbers = new double[list.length];
        System.arraycopy(list, 0, ignoreNumbers, 0, list.length);
        Arrays.sort(ignoreNumbers);
    }
}

From source file:com.github.xbn.array.helper.NewPrimitiveArrayHelper.java

public double[] getEmptyPrimitive() {
    return ArrayUtils.EMPTY_DOUBLE_ARRAY;
}