本文整理了Java中ucar.ma2.Index.getCurrentCounter()
方法的一些代码示例,展示了Index.getCurrentCounter()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Index.getCurrentCounter()
方法的具体详情如下:
包路径:ucar.ma2.Index
类名称:Index
方法名:getCurrentCounter
[英]Get the current counter.
[中]获取当前计数器。
代码示例来源:origin: edu.ucar/netcdf
public int[] getCurrentCounter() {
return counter.getCurrentCounter();
}
代码示例来源:origin: edu.ucar/cdm
public int[] getCurrentCounter() {
return counter.getCurrentCounter();
}
代码示例来源:origin: Unidata/thredds
public int[] getCurrentCounter() {
return counter.getCurrentCounter();
}
代码示例来源:origin: Unidata/thredds
/**
* Use this when this is a one dimensional array of Structures, or you are doing the index calculation yourself for
* a multidimension array. This will read only the ith structure, and return the data as a StructureData object.
* @param index index into 1D array
* @return ith StructureData
* @throws java.io.IOException on read error
* @throws ucar.ma2.InvalidRangeException if index out of range
*/
public StructureData readStructure(int index) throws IOException, ucar.ma2.InvalidRangeException {
Section section = null; // works for scalars i think
if (getRank() == 1) {
section = new Section().appendRange(index,index);
} else if (getRank() > 1) {
Index ii = Index.factory(shape); // convert to nD index
ii.setCurrentCounter(index);
int[] origin = ii.getCurrentCounter();
section = new Section();
for (int anOrigin : origin)
section.appendRange(anOrigin, anOrigin);
}
Array dataArray = read(section);
ArrayStructure data = (ArrayStructure) dataArray;
return data.getStructureData(0);
}
代码示例来源:origin: edu.ucar/netcdf
/**
* Use this when this is a one dimensional array of Structures, or you are doing the index calculation yourself for
* a multidimension array. This will read only the ith structure, and return the data as a StructureData object.
* @param index index into 1D array
* @return ith StructureData
* @throws java.io.IOException on read error
* @throws ucar.ma2.InvalidRangeException if index out of range
*/
public StructureData readStructure(int index) throws IOException, ucar.ma2.InvalidRangeException {
Section section = null; // works for scalars i think
if (getRank() == 1) {
section = new Section().appendRange(index,index);
} else if (getRank() > 1) {
Index ii = Index.factory(shape); // convert to nD index
ii.setCurrentCounter(index);
int[] origin = ii.getCurrentCounter();
section = new Section();
for (int i=0;i<origin.length;i++)
section.appendRange(origin[i], origin[i]);
}
Array dataArray = read(section);
ArrayStructure data = (ArrayStructure) dataArray;
return data.getStructureData(0);
}
代码示例来源:origin: edu.ucar/cdm
/**
* Use this when this is a one dimensional array of Structures, or you are doing the index calculation yourself for
* a multidimension array. This will read only the ith structure, and return the data as a StructureData object.
* @param index index into 1D array
* @return ith StructureData
* @throws java.io.IOException on read error
* @throws ucar.ma2.InvalidRangeException if index out of range
*/
public StructureData readStructure(int index) throws IOException, ucar.ma2.InvalidRangeException {
Section section = null; // works for scalars i think
if (getRank() == 1) {
section = new Section().appendRange(index,index);
} else if (getRank() > 1) {
Index ii = Index.factory(shape); // convert to nD index
ii.setCurrentCounter(index);
int[] origin = ii.getCurrentCounter();
section = new Section();
for (int anOrigin : origin)
section.appendRange(anOrigin, anOrigin);
}
Array dataArray = read(section);
ArrayStructure data = (ArrayStructure) dataArray;
return data.getStructureData(0);
}
内容来源于网络,如有侵权,请联系作者删除!