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

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

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

Index.isFastIterator介绍

暂无

代码示例

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

  1. /**
  2. * This gets the equivalent java array of the wanted type, in correct order.
  3. * It avoids copying if possible.
  4. *
  5. * @param wantType returned object will be an array of this type. This must be convertible to it.
  6. * @return java array of type want
  7. */
  8. public Object get1DJavaArray(Class wantType) {
  9. if (wantType == getElementType()) {
  10. if (indexCalc.isFastIterator()) return getStorage(); // already in order
  11. else return copyTo1DJavaArray(); // gotta copy
  12. }
  13. // gotta convert to new type
  14. Array newA = factory(wantType, getShape());
  15. MAMath.copy(newA, this);
  16. return newA.getStorage();
  17. }

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

  1. /**
  2. * This gets the equivalent java array of the wanted type, in correct order.
  3. * It avoids copying if possible.
  4. *
  5. * @param wantType returned object will be an array of this type. This must be convertible to it.
  6. * @return java array of type want
  7. */
  8. public Object get1DJavaArray(Class wantType) {
  9. if (wantType == getElementType()) {
  10. if (indexCalc.isFastIterator())
  11. return getStorage(); // already in order
  12. else return copyTo1DJavaArray(); // gotta copy
  13. }
  14. // gotta convert to new type
  15. Array newA = factory(wantType, getShape());
  16. MAMath.copy(newA, this);
  17. return newA.getStorage();
  18. }

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

  1. /**
  2. * This gets the equivalent java array of the wanted type, in correct order.
  3. * It avoids copying if possible.
  4. *
  5. * @param wantType returned object will be an array of this type. This must be convertible to it.
  6. * @return java array of type want
  7. */
  8. public Object get1DJavaArray(DataType wantType) {
  9. if (wantType == getDataType()) {
  10. if (indexCalc.isFastIterator())
  11. return getStorage(); // already in order
  12. else return copyTo1DJavaArray(); // gotta copy
  13. }
  14. // gotta convert to new type
  15. Array newA = factory(wantType, getShape());
  16. MAMath.copy(newA, this);
  17. return newA.getStorage();
  18. }

相关文章