ucar.ma2.Index.getSize()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(5.5k)|赞(0)|评价(0)|浏览(127)

本文整理了Java中ucar.ma2.Index.getSize()方法的一些代码示例,展示了Index.getSize()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Index.getSize()方法的具体详情如下:
包路径:ucar.ma2.Index
类名称:Index
方法名:getSize

Index.getSize介绍

[英]Get the total number of elements in the array.
[中]获取数组中元素的总数。

代码示例

代码示例来源:origin: edu.ucar/cdm

/**
 * Create a new Array of type long and the given shape.
 * dimensions.length determines the rank of the new Array.
 *
 * @param dimensions the shape of the Array.
 */
public ArrayString(int[] dimensions) {
 super(dimensions);
 storage = new String[(int) indexCalc.getSize()];
}

代码示例来源:origin: edu.ucar/cdm

/**
 * Create a new Array of type StructureData and the given members and shape.
 * dimensions.length determines the rank of the new Array.
 *
 * @param members a description of the structure members
 * @param shape   the shape of the Array.
 */
protected ArrayStructure(StructureMembers members, int[] shape) {
 super(shape);
 this.members = members;
 this.nelems = (int) indexCalc.getSize();
}

代码示例来源:origin: edu.ucar/cdm

/**
* Create a new Array of type Object and the given shape.
* dimensions.length determines the rank of the new Array.
* @param elementType the type of element, eg String
* @param shape the shape of the Array.
*/
public ArrayObject(Class elementType, int [] shape) {
 super(shape);
 this.elementType = elementType;
 storage = new Object[(int) indexCalc.getSize()];
}

代码示例来源:origin: edu.ucar/netcdf

/**
 * Create a new Array of type int and the given shape.
 * dimensions.length determines the rank of the new Array.
 *
 * @param dimensions the shape of the Array.
 */
public ArrayInt(int[] dimensions) {
 super(dimensions);
 storage = new int[(int) indexCalc.getSize()];
}

代码示例来源:origin: edu.ucar/netcdf

/**
 * Create a new Array of type byte and the given shape.
 * dimensions.length determines the rank of the new Array.
 *
 * @param dimensions the shape of the Array.
 */
public ArrayByte(int[] dimensions) {
 super(dimensions);
 storage = new byte[(int) indexCalc.getSize()];
}

代码示例来源:origin: edu.ucar/netcdf

/**
 * Create a new Array of type short and the given shape.
 * dimensions.length determines the rank of the new Array.
 *
 * @param dimensions the shape of the Array.
 */
public ArrayShort(int[] dimensions) {
 super(dimensions);
 storage = new short[(int) indexCalc.getSize()];
}

代码示例来源:origin: edu.ucar/netcdf

/**
* Create a new Array of type boolean and the given shape.
* dimensions.length determines the rank of the new Array.
* @param dimensions the shape of the Array.
*/
public ArrayBoolean(int [] dimensions) {
 super(dimensions);
 storage = new boolean[(int)indexCalc.getSize()];
}

代码示例来源:origin: edu.ucar/cdm

protected ArrayStructure(StructureMembers members, Index ima) {
 super(ima);
 this.members = members;
 this.nelems = (int) indexCalc.getSize();
}

代码示例来源:origin: edu.ucar/netcdf

/**
* Create a new Array of type long and the given shape.
* dimensions.length determines the rank of the new Array.
* @param dimensions the shape of the Array.
*/
public ArrayLong(int [] dimensions) {
 super(dimensions);
 storage = new long[(int)indexCalc.getSize()];
}

代码示例来源:origin: edu.ucar/netcdf

/**
* Create a new Array of type float and the given shape.
* dimensions.length determines the rank of the new Array.
* @param dimensions the shape of the Array.
*/
public ArrayFloat(int [] dimensions) {
 super(dimensions);
 storage = new float[(int) indexCalc.getSize()];
}

代码示例来源:origin: edu.ucar/netcdf

/**
* Create a new Array of type double and the given shape.
* dimensions.length determines the rank of the new Array.
* @param shape the shape of the Array.
*/
public ArrayDouble(int [] shape) {
 super(shape);
 storageD = new double[(int) indexCalc.getSize()];
}

代码示例来源:origin: edu.ucar/netcdf

/**
 * Create a new Array of type StructureData and the given members and shape.
 * dimensions.length determines the rank of the new Array.
 *
 * @param members a description of the structure members
 * @param shape   the shape of the Array.
 */
protected ArrayStructure(StructureMembers members, int[] shape) {
 super(shape);
 this.members = members;
 this.nelems = (int) indexCalc.getSize();
}

代码示例来源:origin: Unidata/thredds

/**
 * Create a new Array of type StructureData and the given members and shape.
 * dimensions.length determines the rank of the new Array.
 *
 * @param members a description of the structure members
 * @param shape   the shape of the Array.
 */
protected ArrayStructure(StructureMembers members, int[] shape) {
 super(DataType.STRUCTURE, shape);
 this.members = members;
 this.nelems = (int) indexCalc.getSize();
}

代码示例来源:origin: Unidata/thredds

/**
* Create a new Array of type boolean and the given shape.
* dimensions.length determines the rank of the new Array.
* @param dimensions the shape of the Array.
*/
public ArrayBoolean(int [] dimensions) {
 super(DataType.BOOLEAN, dimensions);
 storage = new boolean[(int)indexCalc.getSize()];
}

代码示例来源:origin: edu.ucar/netcdf

/**
 * DO NOT USE, throws UnsupportedOperationException
 */
protected Array createView(Index index) {
 if (index.getSize() == getSize()) return this;
 throw new UnsupportedOperationException();
}

代码示例来源:origin: edu.ucar/netcdf

/**
 * DO NOT USE, throws UnsupportedOperationException
 */
public Array createView(Index index) {
 if (index.getSize() == getSize()) return this;
 throw new UnsupportedOperationException();
}

代码示例来源:origin: Unidata/thredds

/**
 * DO NOT USE, throws UnsupportedOperationException
 */
protected Array createView(Index index) {
 if (index.getSize() == getSize()) return this;
 throw new UnsupportedOperationException();
}

代码示例来源:origin: Unidata/thredds

/**
 * Get the total number of bytes in the array.
 *
 * @return total number of bytes in the array
 */
public long getSizeBytes() {
 DataType dtype = DataType.getType(this);
 return indexCalc.getSize() * dtype.getSize();
}

代码示例来源:origin: edu.ucar/netcdf

/**
 * Get the total number of bytes in the array.
 *
 * @return total number of bytes in the array
 */
public long getSizeBytes() {
 DataType dtype = DataType.getType( getElementType());
 return indexCalc.getSize() * dtype.getSize();
}

代码示例来源: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);
}

相关文章