本文整理了Java中ucar.ma2.Array.copyToNDJavaArray()
方法的一些代码示例,展示了Array.copyToNDJavaArray()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Array.copyToNDJavaArray()
方法的具体详情如下:
包路径:ucar.ma2.Array
类名称:Array
方法名:copyToNDJavaArray
[英]Copy this array to a n-Dimensional Java primitive array of type getElementType() and rank getRank(). Makes a copy of the data.
[中]将此数组复制到getElementType()和rank getRank()类型的n维Java基元数组中。制作数据的副本。
代码示例来源:origin: Unidata/thredds
private void typeSpecifics(Object javaArray) {
System.out.println("typeSpecifics: "+javaArray);
Array aa;
try {
aa = Array.makeFromJavaArray(javaArray, false);
} catch (Exception e) {
System.out.println("TestJavaArray: "+e);
assert(false);
return;
}
Object newArray = aa.copyToNDJavaArray();
testEquals( javaArray, newArray);
}
代码示例来源:origin: ome/formats-gpl
@Override
public Object getArray(String path, int[] origin, int[] shape)
throws ServiceException
{
String groupName = getDirectory(path);
String variableName = getName(path);
Group group = getGroup(groupName);
Variable variable = group.findVariable(variableName);
try {
if (origin != null && shape != null) {
return variable.read(origin, shape).reduce().copyToNDJavaArray();
}
return variable.read().copyToNDJavaArray();
}
catch (InvalidRangeException e) {
throw new ServiceException(e);
}
catch (IOException e) {
throw new ServiceException(e);
}
catch (NullPointerException e) {
return null;
}
}
代码示例来源:origin: openmicroscopy/bioformats
@Override
public Object getArray(String path, int[] origin, int[] shape)
throws ServiceException
{
String groupName = getDirectory(path);
String variableName = getName(path);
Group group = getGroup(groupName);
Variable variable = group.findVariable(variableName);
try {
if (origin != null && shape != null) {
return variable.read(origin, shape).reduce().copyToNDJavaArray();
}
return variable.read().copyToNDJavaArray();
}
catch (InvalidRangeException e) {
throw new ServiceException(e);
}
catch (IOException e) {
throw new ServiceException(e);
}
catch (NullPointerException e) {
return null;
}
}
代码示例来源:origin: Unidata/thredds
assert( aa.getDouble(ima.set(i,j,k)) == tData[i][j][k]);
double[][][] newArray = (double [][][]) aa.copyToNDJavaArray();
for (int i=0; i<shape[0]; i++)
for (int j=0; j<shape[1]; j++)
代码示例来源:origin: Unidata/thredds
assert( newArray[2] == 3.0);
newArray = (double []) aa.copyToNDJavaArray();
assert( newArray[0] == 1.0);
assert( newArray[1] == 2.0);
代码示例来源:origin: Unidata/thredds
int[] actuals = (int[]) fooArray.copyToNDJavaArray();
Assert.assertArrayEquals(expecteds, actuals);
内容来源于网络,如有侵权,请联系作者删除!