1. 添加pom
<dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-lang3</artifactId> </dependency>
2. List<Float>转float[]
List<Float> feature = (List<Float>) jr.get("features"); float[] floatArray = ArrayUtils.toPrimitive(feature.toArray(new Float[0]), 0.0F);
3. List<Double>转double[]
List<Double> yList = new ArrayList<Double>(); Double[] dx = xList.toArray(new Double[xList.size()]); double[] xArray = (double[]) ArrayUtils.toPrimitive(dx);
标签:double,float,List,feature,ArrayUtils,new From: https://www.cnblogs.com/anenyang/p/17720649.html