本文整理了Java中ucar.ma2.Index.getRank()
方法的一些代码示例,展示了Index.getRank()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Index.getRank()
方法的具体详情如下:
包路径:ucar.ma2.Index
类名称:Index
方法名:getRank
[英]Get the number of dimensions in the array.
[中]获取数组中的维数。
代码示例来源:origin: Unidata/thredds
protected Array(DataType dataType, Index index) {
this.dataType = dataType;
this.rank = index.getRank();
this.indexCalc = index;
}
代码示例来源:origin: edu.ucar/cdm
protected Array(Index index) {
rank = index.getRank();
indexCalc = index;
this.datatype = computesort();
}
代码示例来源:origin: edu.ucar/netcdf
protected Array(Index index) {
rank = index.getRank();
indexCalc = index;
this.sort = computesort();
}
代码示例来源:origin: Unidata/thredds
public void testSection() {
Index ima = secA.getIndex();
int [] shape = ima.getShape();
//System.out.println(ima);
assert( ima.getRank() == 3);
assert( ima.getSize() == (mlen * n * p));
assert( shape[0] == mlen);
assert( shape[1] == n);
assert( shape[2] == p);
}
代码示例来源:origin: edu.ucar/cdm
static ArrayObject factory(Class classType, Index index, Object[] storage) {
switch (index.getRank()) {
case 0 : return new ArrayObject.D0(classType, index, storage);
case 1 : return new ArrayObject.D1(classType, index, storage);
case 2 : return new ArrayObject.D2(classType, index, storage);
case 3 : return new ArrayObject.D3(classType, index, storage);
case 4 : return new ArrayObject.D4(classType, index, storage);
case 5 : return new ArrayObject.D5(classType, index, storage);
case 6 : return new ArrayObject.D6(classType, index, storage);
case 7 : return new ArrayObject.D7(classType, index, storage);
default : return new ArrayObject(classType, index, storage);
}
}
代码示例来源:origin: edu.ucar/netcdf
static ArrayDouble factory( Index index, double [] storage) {
switch (index.getRank()) {
case 0 : return new ArrayDouble.D0(index, storage);
case 1 : return new ArrayDouble.D1(index, storage);
case 2 : return new ArrayDouble.D2(index, storage);
case 3 : return new ArrayDouble.D3(index, storage);
case 4 : return new ArrayDouble.D4(index, storage);
case 5 : return new ArrayDouble.D5(index, storage);
case 6 : return new ArrayDouble.D6(index, storage);
case 7 : return new ArrayDouble.D7(index, storage);
default : return new ArrayDouble(index, storage);
}
}
代码示例来源:origin: edu.ucar/cdm
static ArrayLong factory( Index index, long [] storage) {
switch (index.getRank()) {
case 0 : return new ArrayLong.D0(index, storage);
case 1 : return new ArrayLong.D1(index, storage);
case 2 : return new ArrayLong.D2(index, storage);
case 3 : return new ArrayLong.D3(index, storage);
case 4 : return new ArrayLong.D4(index, storage);
case 5 : return new ArrayLong.D5(index, storage);
case 6 : return new ArrayLong.D6(index, storage);
case 7 : return new ArrayLong.D7(index, storage);
default : return new ArrayLong(index, storage);
}
}
代码示例来源:origin: edu.ucar/netcdf
static ArrayLong factory( Index index, long [] storage) {
switch (index.getRank()) {
case 0 : return new ArrayLong.D0(index, storage);
case 1 : return new ArrayLong.D1(index, storage);
case 2 : return new ArrayLong.D2(index, storage);
case 3 : return new ArrayLong.D3(index, storage);
case 4 : return new ArrayLong.D4(index, storage);
case 5 : return new ArrayLong.D5(index, storage);
case 6 : return new ArrayLong.D6(index, storage);
case 7 : return new ArrayLong.D7(index, storage);
default : return new ArrayLong(index, storage);
}
}
代码示例来源:origin: edu.ucar/netcdf
static ArrayFloat factory( Index index, float [] storage) {
switch (index.getRank()) {
case 0 : return new ArrayFloat.D0(index, storage);
case 1 : return new ArrayFloat.D1(index, storage);
case 2 : return new ArrayFloat.D2(index, storage);
case 3 : return new ArrayFloat.D3(index, storage);
case 4 : return new ArrayFloat.D4(index, storage);
case 5 : return new ArrayFloat.D5(index, storage);
case 6 : return new ArrayFloat.D6(index, storage);
case 7 : return new ArrayFloat.D7(index, storage);
default : return new ArrayFloat(index, storage);
}
}
代码示例来源:origin: edu.ucar/netcdf
static ArrayString factory( Index index, String [] storage) {
switch (index.getRank()) {
case 0 : return new ArrayString.D0(index, storage);
case 1 : return new ArrayString.D1(index, storage);
case 2 : return new ArrayString.D2(index, storage);
case 3 : return new ArrayString.D3(index, storage);
case 4 : return new ArrayString.D4(index, storage);
case 5 : return new ArrayString.D5(index, storage);
case 6 : return new ArrayString.D6(index, storage);
case 7 : return new ArrayString.D7(index, storage);
default : return new ArrayString(index, storage);
}
}
代码示例来源:origin: edu.ucar/cdm
static ArrayDouble factory( Index index, double [] storage) {
switch (index.getRank()) {
case 0 : return new ArrayDouble.D0(index, storage);
case 1 : return new ArrayDouble.D1(index, storage);
case 2 : return new ArrayDouble.D2(index, storage);
case 3 : return new ArrayDouble.D3(index, storage);
case 4 : return new ArrayDouble.D4(index, storage);
case 5 : return new ArrayDouble.D5(index, storage);
case 6 : return new ArrayDouble.D6(index, storage);
case 7 : return new ArrayDouble.D7(index, storage);
default : return new ArrayDouble(index, storage);
}
}
代码示例来源:origin: edu.ucar/netcdf
static ArrayObject factory(Class classType, Index index, Object[] storage) {
switch (index.getRank()) {
case 0 : return new ArrayObject.D0(classType, index, storage);
case 1 : return new ArrayObject.D1(classType, index, storage);
case 2 : return new ArrayObject.D2(classType, index, storage);
case 3 : return new ArrayObject.D3(classType, index, storage);
case 4 : return new ArrayObject.D4(classType, index, storage);
case 5 : return new ArrayObject.D5(classType, index, storage);
case 6 : return new ArrayObject.D6(classType, index, storage);
case 7 : return new ArrayObject.D7(classType, index, storage);
default : return new ArrayObject(classType, index, storage);
}
}
代码示例来源:origin: edu.ucar/netcdf
static ArrayBoolean factory( Index index, boolean [] storage) {
switch (index.getRank()) {
case 0 : return new ArrayBoolean.D0(index, storage);
case 1 : return new ArrayBoolean.D1(index, storage);
case 2 : return new ArrayBoolean.D2(index, storage);
case 3 : return new ArrayBoolean.D3(index, storage);
case 4 : return new ArrayBoolean.D4(index, storage);
case 5 : return new ArrayBoolean.D5(index, storage);
case 6 : return new ArrayBoolean.D6(index, storage);
case 7 : return new ArrayBoolean.D7(index, storage);
default : return new ArrayBoolean(index, storage);
}
}
代码示例来源:origin: edu.ucar/cdm
static ArrayFloat factory( Index index, float [] storage) {
switch (index.getRank()) {
case 0 : return new ArrayFloat.D0(index, storage);
case 1 : return new ArrayFloat.D1(index, storage);
case 2 : return new ArrayFloat.D2(index, storage);
case 3 : return new ArrayFloat.D3(index, storage);
case 4 : return new ArrayFloat.D4(index, storage);
case 5 : return new ArrayFloat.D5(index, storage);
case 6 : return new ArrayFloat.D6(index, storage);
case 7 : return new ArrayFloat.D7(index, storage);
default : return new ArrayFloat(index, storage);
}
}
代码示例来源:origin: edu.ucar/cdm
static ArrayBoolean factory( Index index, boolean [] storage) {
switch (index.getRank()) {
case 0 : return new ArrayBoolean.D0(index, storage);
case 1 : return new ArrayBoolean.D1(index, storage);
case 2 : return new ArrayBoolean.D2(index, storage);
case 3 : return new ArrayBoolean.D3(index, storage);
case 4 : return new ArrayBoolean.D4(index, storage);
case 5 : return new ArrayBoolean.D5(index, storage);
case 6 : return new ArrayBoolean.D6(index, storage);
case 7 : return new ArrayBoolean.D7(index, storage);
default : return new ArrayBoolean(index, storage);
}
}
代码示例来源:origin: edu.ucar/cdm
static ArrayChar factory(Index index, char[] storage) {
switch (index.getRank()) {
case 0:
return new ArrayChar.D0(index, storage);
case 1:
return new ArrayChar.D1(index, storage);
case 2:
return new ArrayChar.D2(index, storage);
case 3:
return new ArrayChar.D3(index, storage);
case 4:
return new ArrayChar.D4(index, storage);
case 5:
return new ArrayChar.D5(index, storage);
case 6:
return new ArrayChar.D6(index, storage);
case 7:
return new ArrayChar.D7(index, storage);
default:
return new ArrayChar(index, storage);
}
}
代码示例来源:origin: edu.ucar/netcdf
static ArrayByte factory(Index index, byte[] storage) {
switch (index.getRank()) {
case 0:
return new ArrayByte.D0(index, storage);
case 1:
return new ArrayByte.D1(index, storage);
case 2:
return new ArrayByte.D2(index, storage);
case 3:
return new ArrayByte.D3(index, storage);
case 4:
return new ArrayByte.D4(index, storage);
case 5:
return new ArrayByte.D5(index, storage);
case 6:
return new ArrayByte.D6(index, storage);
case 7:
return new ArrayByte.D7(index, storage);
default:
return new ArrayByte(index, storage);
}
}
代码示例来源:origin: edu.ucar/cdm
static ArrayByte factory(Index index, byte[] storage) {
switch (index.getRank()) {
case 0:
return new ArrayByte.D0(index, storage);
case 1:
return new ArrayByte.D1(index, storage);
case 2:
return new ArrayByte.D2(index, storage);
case 3:
return new ArrayByte.D3(index, storage);
case 4:
return new ArrayByte.D4(index, storage);
case 5:
return new ArrayByte.D5(index, storage);
case 6:
return new ArrayByte.D6(index, storage);
case 7:
return new ArrayByte.D7(index, storage);
default:
return new ArrayByte(index, storage);
}
}
代码示例来源:origin: edu.ucar/netcdf
static ArrayChar factory(Index index, char[] storage) {
switch (index.getRank()) {
case 0:
return new ArrayChar.D0(index, storage);
case 1:
return new ArrayChar.D1(index, storage);
case 2:
return new ArrayChar.D2(index, storage);
case 3:
return new ArrayChar.D3(index, storage);
case 4:
return new ArrayChar.D4(index, storage);
case 5:
return new ArrayChar.D5(index, storage);
case 6:
return new ArrayChar.D6(index, storage);
case 7:
return new ArrayChar.D7(index, storage);
default:
return new ArrayChar(index, storage);
}
}
代码示例来源:origin: edu.ucar/cdm
static ArrayShort factory(Index index, short[] storage) {
switch (index.getRank()) {
case 0:
return new ArrayShort.D0(index, storage);
case 1:
return new ArrayShort.D1(index, storage);
case 2:
return new ArrayShort.D2(index, storage);
case 3:
return new ArrayShort.D3(index, storage);
case 4:
return new ArrayShort.D4(index, storage);
case 5:
return new ArrayShort.D5(index, storage);
case 6:
return new ArrayShort.D6(index, storage);
case 7:
return new ArrayShort.D7(index, storage);
default:
return new ArrayShort(index, storage);
}
}
内容来源于网络,如有侵权,请联系作者删除!