[英]How can I convert a normal array of doubles to a guava immutable array
I was just wondering how would i go about converting this:我只是想知道如何将 go 转换为:
Into a Google Guava ImmutableDoubleArray.进入 Google Guava ImmutableDoubleArray。
public class Data {
private final ImmutableDoubleArray arrays;
public Data(double[] array)
{
}
Thank you.谢谢你。
this.arrays = ImmutableDoubleArray.copyOf(array);
Using ImmutableDoubleArray
is generally preferable to using ImmutableList
, because it does not come with the overhead of boxing.使用
ImmutableDoubleArray
通常比使用ImmutableList
更可取,因为它没有装箱的开销。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.