cdm/src/main/java/ucar/ma2/ArrayObject.java
static ArrayObject factory(DataType dtype, Class elemType, boolean isVlen, Index index, Object[] storage) {
      if (index instanceof Index0D) {
          return new ArrayObject.D0(dtype, elemType, isVlen, index, storage);
      } else if (index instanceof Index1D) {
          return new ArrayObject.D1(dtype, elemType, isVlen, index, storage);
      } else if (index instanceof Index2D) {
          return new ArrayObject.D2(dtype, elemType, isVlen, index, storage);
      } else if (index instanceof Index3D) {
          return new ArrayObject.D3(dtype, elemType, isVlen, index, storage);
      } else if (index instanceof Index4D) {
          return new ArrayObject.D4(dtype, elemType, isVlen, index, storage);
      } else if (index instanceof Index5D) {
          return new ArrayObject.D5(dtype, elemType, isVlen, index, storage);
      } else if (index instanceof Index6D) {
          return new ArrayObject.D6(dtype, elemType, isVlen, index, storage);
      } else if (index instanceof Index7D) {
          return new ArrayObject.D7(dtype, elemType, isVlen, index, storage);
      } else {
          return new ArrayObject(dtype, elemType, isVlen, index, storage);
      }
  }
static ArrayObject factory(DataType dtype, Class elemType, boolean isVlen, Index index, Object[] storage) {
      if (index instanceof Index0D) {
          return new ArrayObject.D0(dtype, elemType, isVlen, index, storage);
      } else if (index instanceof Index1D) {
          return new ArrayObject.D1(dtype, elemType, isVlen, index, storage);
      } else if (index instanceof Index2D) {
          return new ArrayObject.D2(dtype, elemType, isVlen, index, storage);
      } else if (index instanceof Index3D) {
          return new ArrayObject.D3(dtype, elemType, isVlen, index, storage);
      } else if (index instanceof Index4D) {
          return new ArrayObject.D4(dtype, elemType, isVlen, index, storage);
      } else if (index instanceof Index5D) {
          return new ArrayObject.D5(dtype, elemType, isVlen, index, storage);
      } else if (index instanceof Index6D) {
          return new ArrayObject.D6(dtype, elemType, isVlen, index, storage);
      } else if (index instanceof Index7D) {
          return new ArrayObject.D7(dtype, elemType, isVlen, index, storage);
      } else {
          return new ArrayObject(dtype, elemType, isVlen, index, storage);
      }
  }
/* Create new ArrayObject with given indexImpl and backing store.
Should be private.
@param index use this Index
@param stor. use this storage. if null, allocate.
@return. new ArrayObject.D<rank> or ArrayObject object.